mulicheng wrote: > I'm working on a little sub project to allow a few of the sites I've > got running to share some common functionality. Part of the solution > requires a common template. (similar to a widget) > > * I want the template to be defined in the common code base. > * I want the application to be able to extend or modify the template if > applicable (like modifying a widget) > * I want the template to be able to extend an application specific site > master or layout template. > > I noticed a thread a while back (http://tinyurl.com/yb32ta) that talked > about loading templates from a dynamic source. There were some issues > and the proposed solution required adding a KID plugin to load the > template. > > Would this be easier if I switch to Genshi? I'm not opposed to > upgrading anyway since that is the future. > > Ideally I'd like to have something like this in my common controller > method: > > class CommonController: > def __init__(self,mastertemplatename): > self.mastertemplatename=mastertemplatename > > @expose() > def somecommontask(self,**kw): > template=pkg_resources.resource_string(__name__,'commontemplate.txt') > return > dict(tg_template=template,mastertemplatename=self.mastertemplatename)
I posted something a little while back about adding themes to your site. You can find it here: http://groups.google.com/group/turbogears/msg/45da05797acb85dc The concept seems similar to what you are trying to do, although your usage of it would be more complicated. hth, -Adam > > Thoughts? > > Thanks for any input. > -Dennis --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

