Re: [SMARTY] different elements for different sections of site
| From: | Simon Willison | Date: | Wed, 24 Jul 2002 10:49:41 +0000 |
| Subject: | Re: [SMARTY] different elements for different sections of site | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5406@lists.php.net to get a copy of this message | ||
At 10:47 24/07/2002 +0200, Nick Wilson wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everyone, I've just started to use Smarty (and am enjoying it!) and wanted to get an idea of what function/feature I should read up on to help me with this scenario: I have a site that I want to have different left hand menus for each section and occasionally different righthand secitons also. In phplib i would have created template files for the different lefthand menus and just parsed them into the main template. What's the recommended Smarty way of doing this?I don't know that this is the "recommended" way of doing it, but I would have a seperate template for each of the different menus and include them in to the template using this: {include file=$menuTemplate} Then use assign to tell Smarty which template to use: $smarty->assign('menuTemplate', 'leftHandMenu1'); Regards, Simon Willison http://www.bath.ac.uk/~cs1spw/blog/