How to access page_start variable in Navigator
How to access page_start variable in Navigator
How do I access the start_page variable set in {Navigator start_page="TEST"} inside Navigator::Navigation template?
- PinkElephant
- Forum Members
- Posts: 169
- Joined: Fri Feb 06, 2009 2:08 pm
Re: How to access page_start variable in Navigator
Hi MZTech
There's nothing doing in {$nodes|print_r} but {get_template_vars} shows a way:
There's nothing doing in {$nodes|print_r} but {get_template_vars} shows a way:
Code: Select all
<h3>DEBUG: start_page={$actionparams['start_page']|default:'(not specified)'}</h3>
Re: How to access page_start variable in Navigator
Thank you very much. It worked.
Didn't know about {get_template_vars}.
How did you extract that DEBUG: start_page?
When I use {get_template_vars} I dont see start_page.
Didn't know about {get_template_vars}.
How did you extract that DEBUG: start_page?
When I use {get_template_vars} I dont see start_page.
- PinkElephant
- Forum Members
- Posts: 169
- Joined: Fri Feb 06, 2009 2:08 pm
Re: How to access page_start variable in Navigator
With {get_template_vars} in the Nav template you should have seen something like:
... which shows the actionparams array and its keys -- including start_page, when set.
Aside: I wanted to get print_r and {get_template_vars} out there but a more normal approach might be to set a var in the calling template:
... then $jolly_green_giant should be available in the Navigator template (if not, try {$jolly_green_giant='test' scope=global}). This approach is slightly less efficient but probably easier to read/maintain.
Code: Select all
$actionparams (array) = [
.template (string) = Example v02 - Nav submenu DEBUG
.start_page (string) = test
.childrenof (string) = testbed
.show_all (integer) = 1
.loadprops (integer) = 0
.module (string) = Navigator
.action (string) = default
]
Aside: I wanted to get print_r and {get_template_vars} out there but a more normal approach might be to set a var in the calling template:
Code: Select all
{$jolly_green_giant='test'}
{Navigator start_page=$jolly_green_giant}
Re: How to access page_start variable in Navigator
Thank you again for all the information. It was very helpful.
Re: How to access page_start variable in Navigator
Based on that description, I have a feeling that start_page is always equal to {$nodes[0]->alias}. Untested though.start_page="" - Starts the menu displaying at the given start_page and showing that element and it's children only. Takes a page alias.