Menu template & parameters

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
rgreset

Menu template & parameters

Post by rgreset »

I am developping a new menu template for the Menu Manager. Everything works fine but I need to pass some parameters to the menu template, i.e. I would like to write something like {menu template="myTemplate.tpl" myParam="...."}. Is there a way to achieve this ?

Thanks for your help
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu template & parameters

Post by Dr.CSS »

What kind of parameters?
id, class, ?

What ver. of CMSMS, hosted or at home?
rgreset

Re: Menu template & parameters

Post by rgreset »

I am using CMSMS Version 1.0beta6 on my own server.

I am writing a  menu template that use JSCookMenu (http://jscook.sourceforge.net). This script needs at least 2 parameters: 1) the orientation of the menu (vertical or horizontal) and the theme of the menu ('ThemePanel' for instance). Instead of hardcoding them in the tpl file, I would like to pass them when I use the menu, i.e. I would like to write in my page template:

{menu template="jscookmenu.tpl" orientation="hbr" theme="ThemePanel"}

Is there a way to do that ?

Thxs
jhlipsey

Re: Menu template & parameters

Post by jhlipsey »

I am trying to do the same thing.  I wish to pass one or more strings to my template as variables that can be inserted as ID or class identifiers.

Any help in accomplishing this would be greatly appreciated.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Menu template & parameters

Post by calguy1000 »

try creating the smarty variable first, then using it inside your menu manager template

Code: Select all

{assign var=orientation value="vertical"}
{menu template="whatever"}
then you can access $orientation inside the template.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”