• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Include .tpl template inside another
PostPosted: Thu Feb 16, 2017 2:24 pm 
Offline
Power Poster
Power Poster

Joined: Sun Dec 28, 2008 12:15 pm
Posts: 448
Location: Roma, Italy
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Include .tpl template inside another
PostPosted: Thu Feb 16, 2017 4:14 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7838
Location: Fernie British Columbia, Canada
Code:
{include file='module_file_tpl:MyModule;templatename.tpl}

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Include .tpl template inside another
PostPosted: Thu Feb 16, 2017 5:53 pm 
Offline
Power Poster
Power Poster

Joined: Sun Dec 28, 2008 12:15 pm
Posts: 448
Location: Roma, Italy
Thank you, Robert.
It works but there's a weird behaviour:
in cms page template I have:
Quote:
<div class="main_container">{content}...

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


the generated html output is:
Quote:
<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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Include .tpl template inside another
PostPosted: Tue Mar 28, 2017 11:24 am 
Offline
New Member
New Member

Joined: Tue Mar 28, 2017 11:19 am
Posts: 1
thanks fort that.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting