| Re: How to add SmartyMenu to Xoops? |
| by -DJNZ- on 2005/5/2 1:42:37 Quote:
Thanks, I missed that when I read the info. And I got the other thing wrong too - well, I am glad it worked! |
| Re: How to add SmartyMenu to Xoops? |
| by juanjo on 2005/5/1 17:51:18 Thanks! ![]() It did work perfect. I just had to change le="color: #000000"><?php <{menu data=$smarty_menu}> instead of le="color: #000000"><?php <{$smarty_menu}> and voila!! Thank you very much!! PS: there is an array'ed way to do the menus with Smarty also, but I just wanted to have anything that worked and then decide what option to implement. |
| Re: How to add SmartyMenu to Xoops? |
| by -DJNZ- on 2005/5/1 15:54:38 Quote:
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. le="color: #000000"><?php <{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. |
| How to add SmartyMenu to Xoops? |
| by juanjo on 2005/5/1 15:23:36 Hi all xoopsers!! I am trying to make SmartyMenu (http://www.phpinsider.com/php/code/SmartyMenu/) work in my (xoops) site (but of course I couldn't, that's why I'm writing here... :P ) I thought the best option would be to insert the SmartyMenu code in the theme.html webpage. But (opposite to what the author of SmartyMenu suggests) I am not familiar enough with Smarty templating language. I have tried to call a php file I generated (by means of a <?php require('filename.php')?>) from the theme.html, but theme.html does not have any php code at all!! How could I insert the SmartyMenu code in my web page? - I have put the Smarty functions and plugins where it is said to do so - I would like to have this dropdown menu in EVERY page that is loaded, that is why I thought as a good option having the SmartyMenu called from (my) theme.html Any help will be greatly appreciated! Juan J |