Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Changing templates according to the navigation menu

 
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
csoliz7
Smarty n00b


Joined: 23 Sep 2010
Posts: 3

PostPosted: Mon Oct 18, 2010 10:54 pm    Post subject: Changing templates according to the navigation menu Reply with quote

Hi,

I recently installed Smarty and even though I have read the tutorials and gone through the crash course I have not been able to find information on how to assign a different template based on the navigation menu.

I have a template for the index page or first page, but when a user clicks on the about or contact page they should access a page with a different layout. So far I have tried to put a if else on the index.php page in order to display a different template every time the user clicks a link on the navigation menu but I have not been able to get any results. Any help is appreciated. Regards,

Carlos
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7366
Location: Lincoln Nebraska, USA

PostPosted: Mon Oct 18, 2010 11:27 pm    Post subject: Reply with quote

assign a template variable for the menu item, and include the appropriate template from that value.
Back to top
View user's profile Send private message Visit poster's website
csoliz7
Smarty n00b


Joined: 23 Sep 2010
Posts: 3

PostPosted: Tue Oct 19, 2010 9:42 pm    Post subject: menu items Reply with quote

Hi,

Thanks for replying to my post. In regards to settting a variable for every menu item, would you mind elaborating more on that. Could you post an example.

Best Regards,

Carlos Soliz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks 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