From: Chris W. <ch...@cw...> - 2003-08-05 20:24:32
|
Andrew Hurst wrote: > TT version 2.10. Ok, I'll check it out. > In other news, how could I go about changing the theme from within a > template? I want to have most of the pages generated by /Document and > /DocumentPages to use a different main template... Ahh.. interesting. This isn't hard to do, but I don't think there's a way to do it right now. The only tricky part is this: >... > ## in the document::document_detail template, this should show with the > new theme > [% OI.box_add( 'document_tools_box', document = document ); > OI.box_add( 'object_modify_box', object = document ); > DEFAULT theme = OI.theme( mysite_theme ); # <-- specify the theme > for the returned page here, > # hopefully making it > use a different main template as well The 'making it use a different main template' is the slippery part because non-main pages may want to use a different theme and leave the main template the way it is. How about a syntax like: [% DEFAULT theme = OI.theme_fetch( mysite_theme_id, use_main => 'yes' ) %] which would do the main template switcheroo behind the scenes but do what it says for everyone else? (Even more sugar: instead of needing to remember an ID for 'mysite_theme_id' you can specify a name which is then looked up in the 'default_objects' server configuration section...) Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |