Hi all,

Definitely a newbie problem: I would like to have a dynamical
header/footer on every page. I've looked through
http://docs.turbogears.org/1.0/HeadersFooters but what I don't get is
how I would pass the dict corresponding to the header/footer to the
template (that use extend/match, etc recommended by the above receipe)
automatically. What I would like to see is that in the methods of the
controller class I only need to return the dict corresponding to the
data specific to the page referenced by the given method and the dict
corresponding to the header/footer would be still visible for the
templates. In other words, my solution right now is update( )'ing
every single dict before it is returned by its method with the dict
containing data for the header/footer. This seems very redundant:

header_footer = dict( .... header/footer stuff ..... )

class test( controllers.RootController ):
    def page1( self ):
        .................     # logic for page1
        out = dict( ..... )
        out.update( header_footer )
        return out
    def page2( self ):
        ................     # login for page2
        out = dict( ..... )
        out.update( header_footer )
        return out

I'm aware of <?python ....... ?> that might do the trick but I don't
want to use that because then some part of the application logic goes
into the templates which I want to avoid.

Any recommendations?

Cheers,
Daniel

--~--~---------~--~----~------------~-------~--~----~
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