Page 1 of 1
Template inclusion
Posted: Wed Apr 15, 2009 10:28 am
by gregwar
Hi, I'm a new user of CMSMS and i got some question (i appologize if my english is bad, i am french)
I'm using custom templates, but i want to use template pretty much similar on different pages (only some zones are differents). Can i create a template and "include" it in the others ?
Thanks!
Re: Template inclusion
Posted: Wed Apr 15, 2009 10:43 am
by uniqu3
You can export the Template as xml file under "Layou/Theme Manager" and then import it on the new Website.
Re: Template inclusion
Posted: Wed Apr 15, 2009 12:03 pm
by gregwar
I think i didn't explain very well my problem

Can I for example create a template "header" with the doctype, the metas etc. and include it frome other templates with a smarty tag ?
Re: Template inclusion
Posted: Wed Apr 15, 2009 12:30 pm
by vilkis
You can create Global Content Blocks and then include them in templates.
Vilkis
Re: Template inclusion
Posted: Wed Apr 15, 2009 2:24 pm
by tyman00
You don't normally include one template inside of another. But you do have a few options.
1. Create your template and then make copies and make the necessary adjustments depending on the template. Then you can select the template you with to use when you create the page.
2. Create one single template and use Smarty logic to display certain information depending on the current page information. For example I use smarty logic to check for certain page aliases and it displays different information on my site. You can also put the "extra1, extra2, extra3" fields to use here. You can specify something in one of those fields and then use smarty to display your different information depending on the value of those fields.
3. Follow vilkis' idea to a certain extent. Create varrying Global Content Blocks. The only problem is you need to specify which block to use to display the proper header data. You can again use the "extra" fields. In one of those fields you can specify the names of the global content block you would like to use in the header. If you do it right you can also specify a default content block to use if one is accidentally not specified.
Re: Template inclusion
Posted: Thu Apr 23, 2009 5:42 am
by Dr.CSS
Your doctype should be consistent throughout your site so no need to do that, you can add page specific metadata using the meta box in the options tab when editing/making a page, you can use {$page_alias} in a class call to make the pages have different looks depending on what page you are on...
So actually you don't need a lot of different templates to do what you want, try not to over complicate your life...