2
Quote:
juanjo wrote:
...theme.html does not have any php code at all!!
No, the whole point of using Smarty is that template files do not need PHP in them. But to do something like you want, it is possible to put PHP in a template as below - put this somewhere near the beginning of theme.html (just after the <html> tag would do). But IMHO this is not a very efficient way of putting a static menu on your site: there are just too many calls to SmartyMenu methods. If I was writing SmartyMenu I would have used an array for input.
<{php}>
require_once('/path/to/where/you/put/it/SmartyMenu.class.php');
// initialize your menu
SmartyMenu::initMenu($menu);
// first menu item
SmartyMenu::initItem($item);
SmartyMenu::setItemText($item, 'Yahoo');
SmartyMenu::setItemLink($item, 'http://www.yahoo.com/');
SmartyMenu::addMenuItem($menu, $item);
...
$this->assign('smarty_menu', $menu); // for PHP code in a template the Smarty object is in $this
<{/php}>
Then you can just put <{$smarty_menu}> in the template where you want it to appear. Don't forget to put the link to the CSS file in <head> too.