On Sep 16, 1:47 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> On Sep 16, 11:50 am, "Kirk Strauser" <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm still very new to TurboGears and trying to get my head around Kid
> > templates.  Right now I'm playing with the 'master.kid' template that
> > the quickstart gives you.  Suppose I want every page on the site to
> > have a title that ends with the site's name.  For instance, this page:
>
> >     <html xmlns="http://www.w3.org/1999/xhtml";
> > xmlns:py="http://purl.org/kid/ns#"; py:extends="'../master.kid'">
> >     <head>
> >     <title>foo</title>
> >     </head>
> >     <body>
> >     <h2>Test</h2>
> >     <p>This is a test.</p>
> >     </body>
> >     </html>
>
> > should end up with:
>
> >     <title>foo - My Project</title>
>
> > in the <head>.  How would I go about that in Kid?  This probably seems
> > obvious to most of you, but I've been staring at the screen so long
> > that it's stopped making sense.  Thanks!
>
> Seems to me you could set a global var in master.kid containing the
> projects name...ie
>
> <?python project="My Project"?>
>
> Then (i think) that variable would be accessible from within any of
> your templates.  So you could add code like this to the individual
> template.
>
> <title py:content="'foo' + project">Project Name</title>
> or
> <title>foo - ${project}</title>
>
> ~Sean

I think you could also grab it from your config files...  Not sure how
to do that off hand, but I've seen it mentioned on the thread.

~Sean
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to