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

including a sub-template

 
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
dwich
Smarty Rookie


Joined: 11 Oct 2003
Posts: 12
Location: Praha, Czech Republic

PostPosted: Sat Oct 11, 2003 1:53 pm    Post subject: including a sub-template Reply with quote

hi all,
i'm creating templates for 4 languages website. i have 4 navigation templates:
menu-top-en.tpl
menu-top-de.tpl
menu-top-pl.tpl
menu-top-cz.tpl

in main template (main.tpl) i have a variable {$PAGE.language} which contains a 2 letter string (en/de/pl/cz)

all i need is something like in PHP
include('./templates/menu-top-'.$PAGE['language'].'.tpl');

how can i include a navigation template dependent on {$PAGE.language} variable directly from main template?

thanks
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sat Oct 11, 2003 2:01 pm    Post subject: Reply with quote

{include file="menu-top-`$PAGE.language`.tpl"}

see: http://smarty.php.net/manual/en/language.syntax.quotes.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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