Nice!! .. it works very well ... thank you for your fast and clear
advice. cheers!
On Nov 30, 4:32 pm, "David Pollak" <
feeder.of.the.be...@gmail.com>
wrote:
> Oddly enough, I was just dealing with a very similar issue.
>
> The answer comes in two parts.
>
> First, (after checking out head from SVN), you can do the following:
> <lift:surround with="default" extra_script="foo"/>
>
> The attributes passed are now available in S.attr("extra_script")
>
> In your template, you can have a <lift:snippet
> type="Util:processExtraScript"/>
>
> class Util {
> def processExtraScript = S.attr("extra_script").map(n => <script
> src={"/scripts/"+n+".js"}/>).openOr(Nil)
>
> }
>
> What this does is it allows you to define an extra script in the page that's
> surrounding itself. In the surround template, you can process the
> attributes.
>
> Sound reasonable?
>
> Thanks,
>
> David
>
> On 11/30/07, edgarchan <
edgarchancarri...@gmail.com> wrote:
>
>
>
>
>
> > Hi all.
>
> > Question about this:
> > Suppose i have many pages that requires different styles and scripts
> > but results too heavy to put them all on the decorator's head. How can
> > i load specific scripts on different templates?
>
> > Is there any tag that can be used to attach anything to the decorator
> > from the template?
>
> > something like <lift:bind name="content" /> or the opposite of
> > lift:snipped
>
> > After looking around lift examples and code i didn't find a hint. do i
> > missing something?
>
> > thanks.
>
> --
> lift, the secure, simple, powerful web frameworkhttp://
liftweb.net
> Collaborative Task Managementhttp://
much4.us