On 8/12/07, Marcin Kasperski <[EMAIL PROTECTED]> wrote: > >> 5) How would you implement simple constants referred thorough > >> the site in different templates? At the moment I have sth > >> like > >> _const.mako > >> <%def name="author_name()" buffered="True">Marcin > >> Kasperski</%def> > > > > I put those in the base controller's .__call__ method: > > > > c.author_name = u"Marcin Kaperski". > > Hmm. This is a little bit troublesome when I need to override sth > for just a few pages (duplicating controller looks like overkill). > But, well, maybe there is no good solution. Thx for the hint.
I'm not sure what you mean. Every dynamic page needs a controller method. That method can change c.author_name again if the the default value is inappropriate. I found it useful to have little controllers even for quasi-static pages so I can set the title and breadcrumbs. -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
