Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Passing config variables to {include}d templates

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Diabl0
Smarty Rookie


Joined: 21 Aug 2006
Posts: 5

PostPosted: Mon Aug 21, 2006 3:45 pm    Post subject: Passing config variables to {include}d templates Reply with quote

Hi

I have problem with so called smarty config variables. I use them for languages, and want to pass some config values to included templates:

Code:
{include file='header.tpl' section=#section_news#}


but this don't work. $section in header.tpl is empty Sad

I try also tricks like:

Code:
{assign var=section_val value=#section_news#}
{include file='header.tpl' section=$section_val}


but in header.tpl both $section_val and $section are empty.

Can i pass somehow value of #section_news# to included template?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Aug 21, 2006 5:42 pm    Post subject: Reply with quote

Yes, exaclty as you are doing it. Just make sure that your so-called #section_news# has a defined value. Try using {debug} in your template to see the assignments.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP