From: David King <dk...@ketralnis.com>
Date: Fri, 16 Nov 2007 15:24:15 -0800
Local: Fri, Nov 16 2007 6:24 pm
Subject: Re: [erlyweb-list] Re: <title>s and other non-component data
> - A while ago somebody asked a similar question and Bryan Fink That does only take into account <title>s, and not any other > suggested returning a tuple of the form {title, Title} from the view > function, and then later picking up this tuple in the > html_container_controller and using its value to set the <title> tag. metadata. And doesn't using erltl preclude returning something useful from a view function other than the data itself? And then the component receiving the rendered page would have to walk the resultant IOlist looking for it, rather than being able to pattern- match it. That just seems very brittle. I guess I could have one view function like contents([Title,[Contents,AuthorName]]) -> And then another module with the erltl itself, but that also seems > - Use the process dictionary to store any values that need to be used Ech, that sounds terrible, and it relies on Erlyweb doing all of the > later outside the current component. work in one process, which I don't see being a permanently viable assumption. Would it make sense to hack in a return value from the controller {return_with_meta,[{title,"Foo"},{link_rel,"next",link_to_page_2()}], (with a better name, since "return_with_meta" doesn't sound all that > Btw, just curious, what parts of ErlyWeb are you rewriting? Mostly large swaths of erlydb and erlydb_mnesia (in ways that make it work better with mnesia, but that make it incompatible with other DBMSs, which of course the current incarnation avoids). I may end up having to revert this if mnesia can't handle millions of objects, with which it seems to be having trouble once they start to become larger objects than simple tuples. I've hacked in a few return and 'EXIT' handlers from controller functions for special circumstances, like when I want to return a 400- or 500-level HTTP response along with other information. I might try to hack in some WebDAV handling stuff, as I'm considering writing a desktop client for my app in the future and that seems the easiest way to get the data to and from the desktop client. I haven't decided what that's going to look like yet. It looks like I may be hacking in a return value to return extended information to parent controller functions, like <title> tags. but I want to decide how it should work, first. It sounds like it's just not a concern to the two biggest users of erlyweb > Yariv > On Nov 16, 2007 10:19 AM, David King <dk...@ketralnis.com> wrote: >> erlyweb uses a component system for rendering pages. It makes most of >> [{data,post:title(Post)}, >> The view function then looks like: >> <%@ show([Title,Contents,Comments]) %> >> I really like this, because it allows me to separate the view-logic >> I see that Vimagi doesn't set <title> tags (neither <http:// >> It isn't limited to <title>s (for instance, I may want to alert the You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||