Zotonic
Zotonic
zotonic@conference.zotonic.com
Thursday, 17 January 2013< ^ >
arjan has set the subject to: Zotonic - the Erlang Content Management Framework
Room Configuration

GMT+1
[05:48:49] andreas.stenius_ joins the room
[05:49:57] andreas.stenius_ leaves the room
[05:50:07] Andreas Stenius joins the room
[07:44:44] <Andreas Stenius> Hope no one had objections on the optional include addition.. otherwise we'll have to revert it :p
[09:04:40] Arjan joins the room
[09:04:49] <Arjan> lol
[09:04:53] <Arjan> no it's a nice feature
[09:39:19] <Marc Worrell> was thinking we might make more use of those prefixes like "optional", "all" etc
[09:45:13] Arjan leaves the room
[09:47:29] Arjan joins the room
[09:58:18] maas.maarten.zeeman joins the room
[09:59:41] <maas.maarten.zeeman> Indeed, nice addition.
[10:39:41] <maas.maarten.zeeman> btw, was thinking about things missing from the db layer. The idea is that the layer should provide a solution for things which differ from db to db. Think about making querying, getting meta data, making backups. Stuff like that.
[10:40:08] <maas.maarten.zeeman> What also differs is the way queries are parameterized postgres uses $1, sqlite ?1.
[10:41:02] <maas.maarten.zeeman> What would be a good solution for that? User our own format to query?
[10:45:24] Arjan leaves the room
[10:45:39] Arjan joins the room
[10:46:08] <maas.maarten.zeeman> erlyweb has something called erlsql. With this you can construct queries with erlang tuples and atoms. Eg: {select, '*', {from foo}, {where, {id, '=', '?1'}}}
[10:49:22] <maas.maarten.zeeman> Drivers can easily (and quickly) encode this to their flavour of sql. It also eases protecting against sql injection. Curious what you think, like or not?
[10:49:53] <Marc Worrell> sounds good to me
[10:50:20] <Marc Worrell> we need to check how we want to describe some nifty things like full text match
[10:50:32] <Marc Worrell> there postgresql needs sometimes some funny extras
[10:52:08] <maas.maarten.zeeman> hehe indeed
[10:53:46] <maas.maarten.zeeman> I'm a bit hesitant of adding another layer here. For the funny extra's we can still support passing sql as binary.
[10:54:20] <Marc Worrell> yeah, just always add that
[10:54:48] <Marc Worrell> and maybe something in the context/z_db/whatever that we can easily check what db we are running, for the really fun stuff
[10:54:59] <maas.maarten.zeeman> yes
[11:03:59] <maas.maarten.zeeman> db's always have funny extra's...
[11:05:10] <Arjan> we already have #search_sql{} which feels quite similar
[11:05:35] <maas.maarten.zeeman> Cool. Right. Ill take a look at that
[11:05:44] <Arjan> so adding yet another notation feels weird
[11:11:53] <maas.maarten.zeeman> Maybe expand it a little to allow cross db query parameterization.
[11:14:22] <Marc Worrell> Another question
[11:14:37] <Marc Worrell> In the sitemap (and e-mails) we need an absolute url
[11:14:54] <Marc Worrell> should we make a "absurl" tag, or add some option?
[11:15:05] <Arjan> option
[11:15:19] <Arjan> {% url foobar abs %}
[11:15:42] <maas.maarten.zeeman> we have something similar for the lib tag.
[11:16:29] <maas.maarten.zeeman> use_absolute_url
[11:16:30] <Marc Worrell> is just 'abs' not too problematic as namespace? do you think anybody has 'abs' as an argument?
[11:16:55] <maas.maarten.zeeman> http://zotonic.com/docs/0.9/ref/tags/tag_lib.html
[11:17:17] <Marc Worrell> then we can use it here as well
[11:17:18] <Arjan> maas.maarten.zeeman: nice one
[11:17:23] <Arjan> same param name please :)
[11:17:42] <Marc Worrell> and maybe something like "{{ id.page_url with use_absolute_url }}"
[11:18:12] <maas.maarten.zeeman> getting quite long
[11:18:23] <Arjan> make a page_url_abs?
[11:18:32] <Arjan> as long as its documented and consistent, I'm for it ;)
[11:18:33] <Marc Worrell> Then you can change the behavior by setting the use_absolute_url var in the #context{}
[11:18:35] <Marc Worrell> :p
[11:19:20] <Marc Worrell> When we have page_url_abs then we can also have {% url_abs …. %}
[11:19:23] <maas.maarten.zeeman> ok, yes because when used all urls should probably be absulute anyway
[11:20:07] <maas.maarten.zeeman> Is using the base tag an option?
[11:26:34] <maas.maarten.zeeman> using absolute urls is probably safer.
[11:29:12] <Marc Worrell> base tag doesn't work for sitemap.xml :p
[11:30:05] <Marc Worrell> I think a mix is nice - "use_absolute_url" as option in the #context{} (ideal for e-mails!)
[11:30:22] <Marc Worrell> and tags {% url_abs %} and {{ id.page_url_abs }}
[11:30:27] <Arjan> and also not for email
[11:30:30] Arjan leaves the room
[11:32:12] <maas.maarten.zeeman> I use the lib use_absolute_url for embedding stuff in a frame with a base tag pointing to something else :-)
[11:33:36] Arjan joins the room
[11:33:47] <Marc Worrell> LOL
[11:34:49] <Marc Worrell> that sounds like nicely nested stuff "the uncle of the aunt's friend of the brother of my brother's school friend"
[11:35:54] <maas.maarten.zeeman> Indeed, better known as mashups...
[11:37:43] <Marc Worrell> hmmm, same problems with images
[11:37:55] <maas.maarten.zeeman> sure :-)
[11:38:18] <Marc Worrell> maybe adding the "use_absolute_url" option is best, otherwise we end up with many extra tags
[11:38:48] <Arjan> Marc Worrell: I agree
[11:46:28] <Marc Worrell> Ideally the mod_ssl should also be used when creating the absolute_url, then we can make the right url for "is_ssl" dispatch rules
[11:50:31] <Marc Worrell> was thinking of a notification for the abs_url calculation
[11:50:53] <Marc Worrell> then you can always hook into those and send them somewhere else
[11:52:40] <Marc Worrell> maybe even for every generated url? then a module can even send images etc to other hostnames
[11:53:31] <maas.maarten.zeeman> doesn't it just it depends on uri for which the template is currently rendering stuff
[11:57:51] <maas.maarten.zeeman> I've had another occasion when I wanted to know that during rendering. Forgot what that was though.
[11:59:49] <Marc Worrell> yes, so also give the dispatch rule being rendered etc
[12:07:09] <maas.maarten.zeeman> You can get that from the request, but you are not always rendering http requests. Could also be postbacks, hmm.
[12:07:28] vladimir.chujkov joins the room
[12:12:11] <maas.maarten.zeeman> or emails.
[12:19:30] vladimir.chujkov leaves the room
[12:45:40] Arjan leaves the room
[12:46:43] <Marc Worrell> oh, I mean the dispatch rule for the url being rendered :)
[12:48:42] Arjan joins the room
[12:50:41] <maas.maarten.zeeman> ah, I was meaning something to find out for what target we are currently rendering.
[13:30:46] Arjan leaves the room
[13:33:13] Arjan joins the room
[13:44:24] Andreas Stenius leaves the room
[13:46:36] Andreas Stenius joins the room
[14:00:52] Arjan leaves the room
[14:03:43] Arjan joins the room
[14:12:05] <Marc Worrell> done
[14:12:06] <Marc Worrell> (zotonic001@Lamma)38> z_dispatcher:url_for(page, [{id,1}, {slug, "hello"}, use_absolute_url], z:c(test)).
<<"http://test.local:8000/en/page/1/hello">>
[14:12:13] <Marc Worrell> now some documentation….
[14:12:31] <Marc Worrell> (zotonic001@Lamma)31> m_rsc:p(page_home, page_url_abs, z:c(test)).
<<"http://test.local:8000/en/">>
[14:18:45] <Andreas Stenius> +1 :)
[14:20:29] Andreas Stenius leaves the room
[14:20:49] <maas.maarten.zeeman> Nice one. I see i use z_context:abs_url a lot in code. :-)
[14:20:49] andreas.stenius leaves the room
[14:20:53] Andreas Stenius joins the room
[14:21:48] <maas.maarten.zeeman> In services etc...
[14:22:44] <maas.maarten.zeeman> cool
[14:23:49] <Marc Worrell> You can now also set the "use_absolute_url" option in your context, will do the same for you.
[14:24:04] <maas.maarten.zeeman> even m_rsc does that
[14:24:04] <Marc Worrell> z_context:set(use_absolute_url, Context)
[14:24:48] <Marc Worrell> (zotonic001@Lamma)41> m_rsc:p(page_home, page_url, C).
<<"http://test.local:8000/en/">>
[14:30:59] Arjan leaves the room
[14:32:03] Arjan joins the room
[15:00:15] vladimir.chujkov joins the room
[15:29:34] vladimir.chujkov leaves the room
[15:34:40] <Marc Worrell> Ok, committed the 'use_absolute_url' stuff
[15:34:54] <Marc Worrell> both on 0.9.x and master
[15:41:36] vladimir.chujkov joins the room
[16:00:20] vladimir.chujkov leaves the room
[16:01:10] Arjan leaves the room
[16:02:48] vladimir.chujkov joins the room
[16:04:05] Arjan joins the room
[16:16:14] Arjan leaves the room
[16:19:08] Arjan joins the room
[16:46:20] Arjan leaves the room
[16:49:07] Arjan joins the room
[18:01:35] Arjan leaves the room
[18:03:53] Arjan joins the room
[18:16:32] Arjan leaves the room
[18:17:06] Arjan joins the room
[21:02:21] Arjan leaves the room
[21:04:50] Arjan joins the room
[21:17:27] Arjan leaves the room
[21:19:38] Arjan joins the room
[21:21:49] Arjan leaves the room
[21:43:14] maas.maarten.zeeman leaves the room
[22:06:29] maas.maarten.zeeman joins the room
[22:42:54] Arjan joins the room
[23:27:39] Arjan leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!