[Lift] Re: Title function

2009-08-06 Thread Derek Chen-Becker
Putting it in an object won't work, since you probably want the title to be done per-request. To clarify what I'm saying, here's a small example of how I would set the title for an edit page: First, the template: lift:surround at=content head titlelift:Info.title //title /head

[Lift] Re: Title function

2009-08-06 Thread Naftoli Gugenheim
Are you showing me a way for Title to access this information? In this case Info is the original snippet class? Is this a way to access Info.title outside of the instance of Info? What would be ideal, at least in a certain sense, is if there would be some way for the Loc to access the snippet

[Lift] Re: Title function

2009-08-05 Thread Derek Chen-Becker
The snippet itself can bind the title if it has the head inside it. Something like: lift:surround at=content lift:MySnippet.method head titlemysnippet:title //title /head ... /lift:MySnippet.method /lift:surround This is what I do (with no title element in the default template). Derek On

[Lift] Re: Title function

2009-08-05 Thread Naftoli Gugenheim
- Naftoli Gugenheimnaftoli...@gmail.com wrote: So what I'm not clear on now is the input to Title. What is a LocParam, and how do you you use loc params? What is forceParam, defaultParams, param, and foundParam? And in any case how can Title know the value

[Lift] Re: Title function

2009-08-05 Thread Derek Chen-Becker
If you're just looking for a way to programmatically set the title, getting into LocParam might be a little bit of overkill. It's probably simpler to set up your own SessionVars or RequestVars and access them from the Title closure:

[Lift] Re: Title function

2009-08-05 Thread Naftoli Gugenheim
You mean the snippet should put its new/edit flag somewhere that the Title can read, like a top level object? Then it doesn't need to be an AnyVar because it can be set on every request, if Title is processed after the snippet in each request--and if not then I don't see how a RequestVar etc.

[Lift] Re: Title function

2009-08-04 Thread Naftoli Gugenheim
Maybe my setup is atypical then :) My default.html is does not have a title tag; instead each view has its own, relying on head merge. I don't know if originally I had it in default using lift:Menu.title or not, but the difficulty with that would be that some pages can be used to edit or add a