Page 1 of 1

[how to]how to include templates in templates

Posted: Wed Aug 08, 2007 4:10 am
by cloudyfa
I am newbie to this system
I created two templates in layout.one called "main",and another called "footer",I want to include "footer" template in "main".

Tried {template name="footer"},but not work,is there anybody how to include another template or is there any way to do this.
I can't find the answer in documents.

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 6:03 am
by cyberman
Have you tried

Code: Select all

{include file="footer.tpl"}
http://smarty.php.net/manual/en/languag ... nclude.php

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 6:15 am
by cloudyfa
cyberman wrote: Have you tried

Code: Select all

{include file="footer.tpl"}
http://smarty.php.net/manual/en/languag ... nclude.php
thanks cyberman.
yes,it's a solution,but you have to save a template file in server in this way.
I mean if I create templates in admin panel,can they include each other?

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 6:47 am
by cyberman
cloudyfa wrote: I mean if I create templates in admin panel
You can use this tool for editing files in CMSms backend :)

http://dev.cmsmadesimple.org/projects/fileeditor/

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 6:58 am
by cloudyfa
cyberman wrote:
cloudyfa wrote: I mean if I create templates in admin panel
You can use this tool for editing files in CMSms backend :)

http://dev.cmsmadesimple.org/projects/fileeditor/
Cool~~,I'll check it ;D

PS:when I use {include file=filepath},I create a template folder in the root folder of cmsms,if I write a relative path.the file path is not "./template/file" or "../template/file",it is "../../template/file",quite strange,isn't it? :-\

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 7:15 am
by cyberman
cloudyfa wrote: if I write a relative path.the file path is not "./template/file" or "../template/file",it is "../../template/file",quite strange,isn't it? :-\
Maybe this helps for understanding

http://smarty.php.net/manual/en/template.resources.php

Re: [how to]how to include templates in templates

Posted: Wed Aug 08, 2007 3:07 pm
by Dr.CSS
You could make them Global Content Block then put them in template...