Helllo, I'm realtively new to CMSMS, so please bear with me.
I want MenuManager only to display the children of the current section. I can do this manually in my template by specifying the start_page like so:
{cms_module module='menumanager' collapse='1' start_page='living_here'}
That does exactly what I want, but seeing as that module call is in the template, it always shows the "living_here" section's navigation, regardless of the section I'm actually viewing.
Is there a way to do something like this in the template:
{cms_module module='menumanager' collapse='1' start_page='{current_section}'}
so that the current section is dynamically passed to MenuManager from the template? Is there already a list of global variables that can be used this way?
Or is this a change that would need to be made in the code for the MenuManager itself? Perhaps using a $node value?
I appreciate your help.
Thanks,
Matthew
Passing Dynamic Values to Modules? (MenuManager)
Re: Passing Dynamic Values to Modules? (MenuManager)
Have you tried parameter start_level="2"
Re: Passing Dynamic Values to Modules? (MenuManager)
No, I hadn't, but that's exactly what I needed; thank you. 
I had read the help for MenuManager, and now that I've gone back and read through it a couple of times, the description of start_level make sense. It didn't, however, initially, which is why I had to ask.
Still unclear to me is how would passing a 3 as start_level affect the menu? Does "3" even exist? How about 4, 5...? Or, how does that value I pass relate to the hierarchy I've established in Content >> Pages?
Also, is it possible to pass dynamic values into modules, like I asked in the opening post, or does the code in the module called have to look at variable values? Is there a list of {variable} variables that are common to CMSMS?
Thanks again,
Matthew

I had read the help for MenuManager, and now that I've gone back and read through it a couple of times, the description of start_level make sense. It didn't, however, initially, which is why I had to ask.
Still unclear to me is how would passing a 3 as start_level affect the menu? Does "3" even exist? How about 4, 5...? Or, how does that value I pass relate to the hierarchy I've established in Content >> Pages?
Also, is it possible to pass dynamic values into modules, like I asked in the opening post, or does the code in the module called have to look at variable values? Is there a list of {variable} variables that are common to CMSMS?
Thanks again,
Matthew
Re: Passing Dynamic Values to Modules? (MenuManager)
Great that it works
start_level depends on your page hierarchy
e.g you have page hierarchy like
- frontpage (level 1)
- - frontapge children (this is level 2)
- - - frontpage grandchild (this is level 3)
- secondpage (again level 1)
some variables can be used in module calls. it depends on how the variable is created.
For example {sitename} is also $sitename and so can be used for module calls like {somemodule param1=$sitename}
and you can create new variables out of any content with smarty capture.
if I remember syntax correctly its something like
{capture name="variablename"} anythin here including {calls to other modules}{/capture}
now $variablename will contain everything that was between {capture} and {/capture}. This method is not bulletproof and might be slow.
hope this helps
start_level depends on your page hierarchy
e.g you have page hierarchy like
- frontpage (level 1)
- - frontapge children (this is level 2)
- - - frontpage grandchild (this is level 3)
- secondpage (again level 1)
some variables can be used in module calls. it depends on how the variable is created.
For example {sitename} is also $sitename and so can be used for module calls like {somemodule param1=$sitename}
and you can create new variables out of any content with smarty capture.
if I remember syntax correctly its something like
{capture name="variablename"} anythin here including {calls to other modules}{/capture}
now $variablename will contain everything that was between {capture} and {/capture}. This method is not bulletproof and might be slow.
hope this helps
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: Passing Dynamic Values to Modules? (MenuManager)
Create a new User Defined Tag named "page_alias" with the following content:mkuehn wrote: Is there a way to do something like this in the template:
{cms_module module='menumanager' collapse='1' start_page='{current_section}'}
so that the current section is dynamically passed to MenuManager from the template? Is there already a list of global variables that can be used this way?
Code: Select all
global $gCms;
$gCms->smarty->assign('page_alias', $gCms->variables['page_name']);
Code: Select all
{page_alias}
{cms_module module='menumanager' collapse='1' start_page="$page_alias"}
Hope this helps,
Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 
