On Thu, Dec 4, 2008 at 12:38 PM, Marius <[EMAIL PROTECTED]> wrote:

>
>
>
> On Dec 4, 10:29 pm, "David Pollak" <[EMAIL PROTECTED]>
> wrote:
> > On Thu, Dec 4, 2008 at 12:24 PM, Marius <[EMAIL PROTECTED]> wrote:
> >
> > > Unless I'm missing something LiftRules.addTemplateBefore should
> > > suffice. Lift (see findVisibleTemplate which is called before
> > > processSurroundAndInclude) will look for your template so your Pf can
> > > return it virtually from anywhere.
> >
> > However, findVisibleTemplate is not called by the mechanism that looks up
> > the surround template. :-(
>
> Any particular reason not to? ... seems like it is at least as
> appropriate as LiftRules.viewDispatch.It would boil down to
> findAnyTemplate logic isn't it? .. but then again is there some sort
> of redundancy between templates Pf and viewDispatch ? .. which would
> have higher precedence?


The issue is that TemplatePF does its lookup based on a Req... the request.
This makes sense because you may want to look things up based on an incoming
request including the path, the postfix, etc.  On the other hand,
findTemplate is called with a path... a List[String] because it's no longer
part of the Req, but being called by something beyond the Req.  I tried to
unify the two constructs about a month ago and found use cases in my code
for both constructs... thus they are both in Lift and serve their own
purpose.


>
>
> >
> >
> >
> >
> >
> > > Br's,
> > > Marius
> >
> > > On Dec 4, 10:10 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > > > Ahh. What would make this really simple is if LiftRules.finder was a
> PF
> > > > instead of a straight def, since LiftRules.finder is what actually
> tries
> > > to
> > > > locate the template using ClassLoader.getResourceAsStream currently.
> In
> > > the
> > > > meantime, you might have luck with LiftRules.liftTagProcessing. You
> can
> > > > define your own PF that handles surround specially. In particular,
> I'd
> > > look
> > > > at processSurroundElement (and the related findAndMerge and
> processBind)
> > > in
> > > > LiftSession.scala.
> >
> > > > Derek
> >
> > > > On Thu, Dec 4, 2008 at 1:27 PM, Tim Perrett <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > I am indeed talking about lift:surround :)
> >
> > > > > I see processSurroundAndInclude and what it does, but what i really
> > > > > want to do it set the content of the surround dynamically (from a
> > > > > layout i'll store in the DB)
> >
> > > > > How would one go about doing this?
> >
> > > > > Cheers
> >
> > > > > Tim
> >
> > > > > On Dec 4, 7:01 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]>
> wrote:
> > > > > > Are you talking about <lift:surround/> tags? Those are handled in
> > > > > > LiftSession.processSurroundAndInclude, line 697. Here's some
> example
> > > code
> > > > > > for a utility method from an old app that uses it in some
> DispatchPFs
> > > I
> > > > > was
> > > > > > running:
> >
> > > > > >   def process (xhtml : NodeSeq) : XmlResponse = {
> > > > > >     val data = <lift:surround with="default"
> > > > > > at="content">{xhtml}</lift:surround>
> > > > > >     XmlResponse(<html>{
> > > > > > S.session.open_!.processSurroundAndInclude(S.uri,data)}</html>)
> > > > > >   }
> >
> > > > > > Derek
> >
> > > > > > On Thu, Dec 4, 2008 at 12:50 PM, Tim Perrett <
> [EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > > Hey guys,
> >
> > > > > > > Within lift, I cant seem to find where the content returned
> from
> > > > > > > whatever template mech then gets bound to the layout content?
> >
> > > > > > > Can someone point me in the right direction?
> >
> > > > > > > Cheers
> >
> > > > > > > Tim
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Collaborative Task Managementhttp://much4.us
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to