Is there any way to include a template into another one?
My problem is that I have 7 sections in my CMS. These sections should have the same template, but different CSSs. So, instead of making 7 copies of the same template (with different names) and link the 7 CSSs to them, I thought to maintain just one template, while in the other six just put a reference to it (something like 'include...'). This is to avoid that if I have to edit the template, I should replicate the edit 7 times...
include a template from another one
-
100rk
Re: include a template from another one
'Sections should have the same template...' You mean 'sections can be a part of the same template', don't You? In this case You have to ask Yourself, why You don't describe Your different 'sections of ONE template' in different CSS styles, all of them attached to Your complex template. Do You know, what I mean?saltydog wrote: These sections should have the same template, but different CSSs.
OR - if I am wrong and You mean ordinary Smarty tags
Code: Select all
{include file="filename.tpl"}
Last edited by 100rk on Thu Mar 10, 2005 11:28 pm, edited 1 time in total.
Re: include a template from another one
Thank you. Very interesting reply from which I will take advantage, for sure.
But let my try to explain my (simple) problem. The site has a menu with 7 main entries (let's call them rooms). The site uses all the same template for every room, except for the "thebody" style, which is different.
Now, I would like the authors, when they upload an article, are able to link their article with the correct style and the simplest way to let them do this is to have 7 templates (tpl_room1, tpl_room2, etc) from which they easily select in the combobox when uploading the article.
But let my try to explain my (simple) problem. The site has a menu with 7 main entries (let's call them rooms). The site uses all the same template for every room, except for the "thebody" style, which is different.
Now, I would like the authors, when they upload an article, are able to link their article with the correct style and the simplest way to let them do this is to have 7 templates (tpl_room1, tpl_room2, etc) from which they easily select in the combobox when uploading the article.
-
100rk
Re: include a template from another one
Oh, I see I wasn't understand Your needs...
Answer is: Yes, in this time You have to make 7 different templates (or only with different names)
but for make this thing easiest (or comfortable) as possible for You, You can create one CSS stylesheet with common CSS attributes for all Your templates (if there are any common values) and special CSS settings for every template You can write down into textarea CSS in 'template edit' page, because tag {stylesheet} will include both CSS styles - 'main' and attached also. In this case there will be 7 templates with its own special CSS settings and only 1CSS style linked to every of those templates. AND - I hope wysiwyg editor will attach all proper CSS settings which You use in every template (and attached CSS) so when user change template in dropdown, look of wysiwyg content in editor will be properly changed.
I mean: user can change template (not template CSS) in during creating/editing content page and You have to make peace with this fact.
Answer is: Yes, in this time You have to make 7 different templates (or only with different names)
I mean: user can change template (not template CSS) in during creating/editing content page and You have to make peace with this fact.
Last edited by 100rk on Fri Mar 11, 2005 9:24 am, edited 1 time in total.

