|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Diabl0 Smarty Rookie
Joined: 21 Aug 2006 Posts: 5
|
Posted: Mon Aug 21, 2006 3:45 pm Post subject: Passing config variables to {include}d templates |
|
|
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
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Aug 21, 2006 5:42 pm Post subject: |
|
|
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 |
|
|
|
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
|