CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Include .tpl template inside another
https://forum.cmsmadesimple.org/viewtopic.php?f=6&t=76178
Page 1 of 1

Author:  nervino [ Thu Feb 16, 2017 2:24 pm ]
Post subject:  Include .tpl template inside another

Hello,
I have a module with its .tpl templates; I want to include one of these templates inside another (both tempates are in "modules/MyModule/templates" dir). I tried with the smarty {include} without success.
Is it possible?

Thanks

Author:  calguy1000 [ Thu Feb 16, 2017 4:14 pm ]
Post subject:  Re: Include .tpl template inside another

\$1:
{include file='module_file_tpl:MyModule;templatename.tpl}

Author:  nervino [ Thu Feb 16, 2017 5:53 pm ]
Post subject:  Re: Include .tpl template inside another

Thank you, Robert.
It works but there's a weird behaviour:
in cms page template I have:
\$1:
<div class="main_container">{content}...

the included .tpl starts with:
\$1:
<div class="col-md-3 left_col">


the generated html output is:
\$1:
<div class="main_container"><p></p><div class="col-md-3 left_col">

I solved adding a css rule to hide the empty paragraph; not very clean but it works.

Author:  trice001 [ Tue Mar 28, 2017 11:24 am ]
Post subject:  Re: Include .tpl template inside another

thanks fort that.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/