Can someone explain how I go about determining if the current page's hierarchy level >=3?
I'm trying to add a secondary subtitle to pages that are 3 levels or deeper in the site page structure.
Thanks,
Brian
Determine site hierarchy level of current page
Re: Determine site hierarchy level of current page
Do you mean the
Ronny
parameter that is in the MenuManager to check its level?$node->depth -- Depth (level) of this node in the current menu
Ronny
Re: Determine site hierarchy level of current page
I tried all the MenuManager options. However, since the navigation is split across separate menu calls, MenuManager does seem to think anything is more than 2 levels deep (which would be correct at the point of the {menu} calls in the template).RonnyK wrote: Do you mean theparameter that is in the MenuManager to check its level?$node->depth -- Depth (level) of this node in the current menu
Ronny
What I'm thinking now is creating a UDT to split $gCms->variables['friendly_position'] into an array, then counting the number of items in the array to determine page depth (ie. 2.2 = two levels, 1.3.2 = three levels). With all the other info readily available, I had hoped I was overlooking a much simpler method of doing the same.
Thanks,
Brian
Re: Determine site hierarchy level of current page
OK. So, I went the UDT route and seem to be in good shape. I'd still be interested in hearing if there's an easier way to go about all this:
My UDT (get_page_position):
The, in my template:
Brian
My UDT (get_page_position):
Code: Select all
global $gCms;
$hierarchy = count(explode(".", $gCms->variables['friendly_position']));
$smarty->assign('page_level', $hierarchy);
Code: Select all
{get_page_position}
{if ($page_level gte "3")}
{$cgsimple->get_page_menutext($cgsimple->get_parent_alias(),'')} ::
{/if}
{title}