tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/12603-incorrect-path-in-submenusCascade CMS: Discussion 2017-10-26T20:45:39Ztag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-21T21:40:50Z2015-09-22T21:06:11ZIncorrect path in submenus<div><p>Hi-</p>
<p>On one of our sites, the script sorting left menu is not
displaying the correct path link for inner folders- for example
here:<br>
<a href="http://stage.aurora.edu/woodstock/academics/adult-degree-completion-programs/nursing/index.html">
http://stage.aurora.edu/woodstock/academics/adult-degree-completion...</a>#<br>
The bottom -most link, AU and MCC partnership program test does not
append /index to the very end and hence throws an error within
cms(404)... Also, when you do get to the page, it is supposed to
bold the AU mcc part on same left nav as any other link, instead it
throws you out directly under adult degree completion programs and
rest of the left nav disappears.</p>
<p>Here is the left nav velocity script that I have been
experimenting with-</p>
<pre>
<code>#*
Authors: Jim Petkus, John Kocsis
Owner: Aurora University
Copyright: Aurora University
Function: Build Left Navigation Dynamically
Original Date: 1-19-2012
Last Modified: 1-29-2012
Version: 1.12.1.29
Please keep notes if you change anything, update version and dates as needed.
*#
#*
The #displaychildren($node) macro will check the passed $node to see if it matches the folder that we are currently in.
If true then this directory will displayed and checked for children to display.
If on the current page then then there are no more levels to dig through and it should be highlighted.
*#
#macro(displaychildren $node)
#set ($checkfolder = $node.getChild('path').value)
#set ($displaychildren = 0)
#set ($active = 0)
#if ($node.getAttribute('current').value == "true")
#set ($active = 1)
#end
#if ($node.name == "system-folder")
#foreach ($path in $currentpath)
#if ($path.getChild('name').value == $_StringTool.substringAfter($checkfolder, $level))
#set ($displaychildren = 1)
#set ($active = 1)
#end
#end
#end
#end
#*
The #linkorfile($node $arrow) macro will test the passed $node to see if it is a reference link (i.e. system-file or system-symlink).
If true then display the simlink or file in the left nav.
$arrow is used to tell which level the item is on and display the appropriate arrow.
2 = top level, 0 = 2nd levels, 1 = all other levels.
*#
#macro(linkorfile $node $arrow)
#if ($shownav == 1)
<li>
<a href="$node.getChild('path').value">
#if ($arrow == 2)
<div class="accnav_arrow_1">&#187;</div>
$_SerializerTool.serialize($node.getChild('display-name'), true)
#elseif ($arrow == 1)
<div class="accnav_arrow_3">&#8226;</div>
<div class="lnav_name">$_SerializerTool.serialize($node.getChild('display-name'), true)</div>
#elseif ($arrow == 0)
<div class="accnav_arrow_2">&#187;</div>
<div class="lnav_name">$_SerializerTool.serialize($node.getChild('display-name'), true)</div>
#end
</a>
</li>
#else
#set ($checknav = 1)
#end
#end
#*
The #program macro is called only when in the /aurora/academics/programs-majors/graduate or /aurora/academics/programs-majors/undergraduate
directories and will not display additional menus until a program or major has been selected. Then the program and submenu items will be
generated and displayed on the page.
*#
#macro(program)
#set ($program = $_XPathTool.selectSingleNode($contentRoot, "//system-folder[@current = 'true']"))
#if ($_StringTool.substringAfter($program.getChild('path').value, $level) != 'graduate-programs' && $_StringTool.substringAfter($program.getChild('path').value, $level) != 'adult-degree-completion-programs')
<li>
#set ($href = $program.getChild('path').value + "/index")
<a class="active" href="$href">
<div class="accnav_arrow_2">&#187;</div>
<div class="lnav_name">$_SerializerTool.serialize($program.getChild('display-name'), true)</div>
</a>
<ul class="progmenu">
#foreach ($pitem in $program.children)
#if ( ($pitem.getAttribute('reference').value == "true" || $pitem.name == "system-symlink" || $pitem.name == "system-file") && $pitem.getChild('display-name') && $pitem.getChild('display-name').value != "" )
#linkorfile($pitem 1)
#else
#foreach ($pmeta in $pitem.children)
#if ($pmeta.getChild('name').value == 'left-nav' && $pmeta.getChild('value').value == 'Yes')
<li>
#if ($pitem.getAttribute('current').value == "true")
<a class="active" href="$pitem.getChild('path').value">
#else
<a href="$pitem.getChild('path').value">
#end
<div class="accnav_arrow_3">&#8226;</div>
<div class="lnav_name">$_SerializerTool.serialize($pitem.getChild('display-name'), true)</div>
</a>
</li>
#end
#end
#end
#end
</ul>
</li>
#end
#end
#*
The #recurse($node $indent $folder) is only called when $displaychildren = 1.
$node is the folder xpath that we need to loop through and display, as well
as check to see if there are further levels to loop through.
$indent is either 0 or 1 if we wish to indent or not.
(original setup is to indent only after the first itteration)
$folder is the folder to be checked against $level and to see if under programs-majors.
This macro will loop through the passed node looking for folders or pages which have been set
to display in the left nav and check to see if there are submenus to display based on the
current folder.
-- Caution --
This macro does call it self in recursive fashion in order to keeep building submenus,
if there are to many levels deep eventually the column width will be insufficient to
display all the submenus without overflow.
*#
#macro(recurse $node $indent $folder)
#foreach ($path in $currentpath)
#if ($path.getChild('name').value == $_StringTool.substringAfter($folder, $level))
#if ($indent == 0)
<ul class="menu">
#else
<ul class="submenu">
#end
#if ($folder == '/woodstock/academics/graduate-programs' || $folder == '/woodstock/academics/adult-degree-completion-programs')
#program()
#end
#if ($node.name == "system-folder")
#set ($level = $level + $path.getChild('name').value + "/")
#end
#foreach ($child in $node.children)
#if ( ($child.getAttribute('reference').value == "true" || $child.name == "system-symlink" || $child.name == "system-file") && $child.getChild('display-name') && $child.getChild('display-name').value != "" )
#linkorfile($child $indent)
#else
#foreach ($meta in $child.children)
#if ($meta.getChild('name').value == 'left-nav' && $meta.getChild('value').value == 'Yes')
#displaychildren($child)
<li>
#if ($child.name == "system-page")
#set ($href = $child.getChild('path').value)
#elseif ($child.name == "system-folder")
#set ($href = $child.getChild('path').value + "/index")
#end
#if ($active == 1)
<a class="active" href="$href">
#else
<a href="$href">
#end
#if ($indent == 0)
<div class="accnav_arrow_2">&#187;</div>
#else
<div class="accnav_arrow_3">&#8226;</div>
#end
<div class="lnav_name">$_SerializerTool.serialize($child.getChild('display-name'), true)</div>
</a>
#if ($displaychildren == 1)
#recurse($child 1 $child.getChild('path').value)
#end
</li>
#end
#end
#end
#end
</ul>
#end
#end
#end
#*
This is the main part of the program that calls the macros above as needed.
We set the main xpath folders begining at the root level of the site and display first
the main level of the site. Folders and pages are located using the macros above to
build the submenu structure.
*#
#set ($currentpath = $_XPathTool.selectNodes($contentRoot, "/system-index-block/descendant::system-folder[descendant::system-page[@current = 'true']]"))
#set ($currentpage = $_XPathTool.selectSingleNode($contentRoot, "//system-page[@current = 'true']"))
#set ($rootmenu = $_XPathTool.selectSingleNode($contentRoot, "//system-folder[path='/woodstock']"))
#set ($level = "/woodstock/")
#set ($checknav = 0)
#set ($shownav = 0)
#foreach ($topmenu in $rootmenu.children)
##if ($topmenu.getChild('dynamic-metadata').getChild('name').value == 'top-nav' && $topmenu.getChild('dynamic-metadata').getChild('value').value == 'Yes')
#foreach ($path in $currentpath)
#if ($path.getChild('name').value == $_StringTool.substringAfter($topmenu.getChild('path').value, $level))
#if ($topmenu.name == "system-folder")
#set ($level = $level + $path.getChild('name').value + "/")
#end
#foreach ($leftmenu in $topmenu.children)
#if ( ($leftmenu.getAttribute('reference').value == "true" || $leftmenu.name == "system-symlink" || $leftmenu.name == "system-file") && $leftmenu.getChild('display-name') && $leftmenu.getChild('display-name').value != "" )
#linkorfile($leftmenu 2)
#else
#foreach ($meta in $leftmenu.children)
#if ($meta.getChild('name').value == 'left-nav' && $meta.getChild('value').value == 'Yes')
#set ($checknav = 1)
#end
#end
#end
#end
#if ($checknav == 1)
<nav class="subnav">
<ul class="lnav subnav-list" id="left_nav">
#set ($shownav = 1)
#end
#foreach ($leftmenu in $topmenu.children)
#if ( ($leftmenu.getAttribute('reference').value == "true" || $leftmenu.name == "system-symlink" || $leftmenu.name == "system-file") && $leftmenu.getChild('display-name') && $leftmenu.getChild('display-name').value != "" )
#linkorfile($leftmenu 2)
#else
#foreach ($meta in $leftmenu.children)
#if ($meta.getChild('name').value == 'left-nav' && $meta.getChild('value').value == 'Yes')
#displaychildren($leftmenu)
<li>
#if ($leftmenu.name == "system-page")
#set ($href = $leftmenu.getChild('path').value)
#else
#set ($href = $leftmenu.getChild('path').value + "/index")
#end
#if ($active == 1)
<a class="active" href="$href">
#else
<a href="$href">
#end
<div class="accnav_arrow_1">&#187;</div>
$_SerializerTool.serialize($leftmenu.getChild('display-name'), true)
</a>
#if ($displaychildren == 1)
#recurse($leftmenu 0 $leftmenu.getChild('path').value)
#end
</li>
#end
#end
#end
#end
#if ($shownav == 1)
</ul>
</nav>
#end
#end
#end
##end
#end</code>
</pre>
<p>I am a little lost at this point. Any help would be greatly
appreciated. Thanks so much.</p>
<p>Shruti</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T14:43:19Z2015-09-23T14:43:19ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>When you have a moment, would you also be able to attach some
sample XML so I can take a look at the Format in my local instance.
The sample XML can be obtained by editing the Format and selecting
the appropriate Block and Context page within the <strong>Preview
Options</strong> section.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T17:15:02Z2015-09-23T17:15:02ZIncorrect path in submenus<div><p>Thanks, Ryan-</p>
<p>Please find the xml attached.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T17:44:00Z2015-09-23T17:44:00ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>Unfortunately, it does not look like the attached file is valid
XML. Did you by chance grab the XML provided in the top "preview"
box, or the result of clicking the Test Format button?</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T17:53:08Z2015-09-23T17:53:08ZIncorrect path in submenus<div><p>How about now?</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T17:53:52Z2015-09-23T17:53:52ZIncorrect path in submenus<div><p>updated file attached</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T18:14:48Z2015-09-23T18:14:48ZIncorrect path in submenus<div><p>Perfect, thank you Shruti.</p>
<p>Looking over your Format, I believe the problem is within your
<strong>program</strong> macro. Specifically, all of the other
macros have something like the following which is what is adding on
that <code>/index</code> for folders.</p>
<pre>
<code>#if ($child.name == "system-page")
#set ($href = $child.getChild('path').value)
#elseif ($child.name == "system-folder")
#set ($href = $child.getChild('path').value + "/index")
#end</code>
</pre>
<p>My initial thought is that you would want to do something
similar here.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T20:15:17Z2015-09-23T20:15:17ZIncorrect path in submenus<div><p>Hi Ryan-</p>
<p>That was my initial thought as well, and I did try this change
in program macro #macro(program)<br>
#set ($program = $_XPathTool.selectSingleNode($contentRoot,
"//system-folder[@current = 'true']")) #if
($_StringTool.substringAfter($program.getChild('path').value,
$level) != 'graduate-programs' &&
$_StringTool.substringAfter($program.getChild('path').value,
$level) != 'adult-degree-completion-programs')</p>
<ul>
<li>#set ($href = $program.getChild('path').value + "/index")
<a href="$href" class="active"><br></a></li>
</ul>
<div class="accnav_arrow_2">»</div>
<div class="lnav_name">
$_SerializerTool.serialize($program.getChild('display-name'),
true)</div>
<br>
<ul class="progmenu">
<li>#foreach ($pitem in
$program.children)<br>
#if ( ($pitem.getAttribute('reference').value == "true" ||
$pitem.name == "system-symlink" || $pitem.name == "system-file")
&& $pitem.getChild('display-name') &&
$pitem.getChild('display-name').value != "" ) #linkorfile($pitem 1)
#else #foreach ($pmeta in $pitem.children) #if
($pmeta.getChild('name').value == 'left-nav' &&
$pmeta.getChild('value').value == 'Yes')
<pre>
<code> <li>
#if ($pitem.name == "system-page")
#set ($href = $pitem.getChild('path').value)
#elseif ($pitem.name == "system-folder")
#set ($href = $pitem.getChild('path').value + "/index")
#end
#if ($pitem.getAttribute('current').value == "true")
<a class="active" href="$pitem.getChild('path').value">
#else
<a href="$pitem.getChild('path').value">
#end
<div class="accnav_arrow_3">&#8226;</div>
<div class="lnav_name">$_SerializerTool.serialize($pitem.getChild('display-name'), true)</div>
</a>
</li>
#end
#end
#end
#end
</ul></code>
</pre></li>
<li>#end #end
<p>This didn't change anything. Am I missing anything?</p>
</li>
</ul></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T20:50:04Z2015-09-23T20:50:04ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>I am seeing the following in your macro:</p>
<pre>
<code>#if ($pitem.getAttribute('current').value == "true")
<a class="active" href="$pitem.getChild('path').value">
#else
<a href="$pitem.getChild('path').value">
#end</code>
</pre>
<p>Instead, try making the following change:</p>
<pre>
<code>#if ($pitem.getAttribute('current').value == "true")
<a class="active" href="$href">
#else
<a href="$href">
#end</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T20:58:01Z2015-09-23T20:58:01ZIncorrect path in submenus<div><p>Great! That fixed one of the issues. I can get to the index page
but the menu changes and the page out when you click on it, Like
here: <a href="http://stage.aurora.edu/woodstock/academics/adult-degree-completion-programs/nursing/index.html">
http://stage.aurora.edu/woodstock/academics/adult-degree-completion...</a></p>
<p>Thanks!</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:04:59Z2015-09-23T21:04:59ZIncorrect path in submenus<div><p>Glad to hear the latest change resolved the <code>index</code>
issue.</p>
<p>To confirm, when you click on the sub-folder link, are you
looking to continue to show the same navigation that you see when
viewing the link you just provided? If so, it sounds like this may
be due to one of two things:</p>
<ul>
<li>Your Index Block is only including the current folder's
siblings and not the descendant hierarchy, so your Format is
literally just displaying the current page's parent folders and any
of it's siblings</li>
<li>Your Format needs to be tweaked so it displays all of the
hierarchy and not just the current page's siblings</li>
</ul>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:19:46Z2015-09-23T21:19:46ZIncorrect path in submenus<div><p>The block is actually set at this- "Start at the current page
with folder hierarchy, and also include siblings"</p>
<p>Is this to be changed?</p>
<p>Thanks!</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:28:14Z2015-09-23T21:28:14ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>Perhaps try using the <strong>Start at the current page with
folder hierarchy, siblings, and also render forward</strong> option
to see if it will include the children of the folder hierarchy.
Also, make sure you have an appropriate value entered for the
render depth option.</p>
<p>Let me know if this makes a difference. If not, you may need to
select the base folder (or one of the parent folders) as the
starting point and just include everything.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:48:50Z2015-09-23T21:48:50ZIncorrect path in submenus<div><p>Okay, thanks, Ryan! Tried adding index folder an d all other
options as well. Either everything disappears or it stays the
same.</p>
<p>Is there anything that needs to be changed in the script?</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:57:01Z2015-09-23T21:57:01ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>My best guess is you would need to either tweak some XPath or
the way the Format traverses the hierarchy.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T21:58:48Z2015-09-23T21:58:48ZIncorrect path in submenus<div><p>Thanks, Ryan. I'll try a few things and see if it gets me
anywhere.</p>
<p>Appreciate your help.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-09-23T22:06:12Z2015-09-23T22:06:12ZIncorrect path in submenus<div><p>Not a problem at all, Shruti. Definitely look into those couple
of items and keep me posted on your progress or if you have any
questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-06T20:10:33Z2015-10-06T20:10:33ZIncorrect path in submenus<div><p>Hi Ryan- I went backto the script and tried all different
options for index folder but I am a little lost at the recurse
macro. The menu that builds for sub folder is completely out of the
main navigation. Like here: <a href="http://stage.aurora.edu/woodstock/academics/adult-degree-completion-programs/nursing/au-mcc-partnership-test/index.html#.VhQpFGuBxOJ">
http://stage.aurora.edu/woodstock/academics/adult-degree-completion...</a></p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-07T12:08:10Z2015-10-07T12:08:10ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>When you have a moment, please attach the following so I can
help take a closer look:</p>
<ul>
<li>Your Format as it currently stands</li>
<li>Sample XML of your Index Block with the <strong>AU and MCC
Nursing Partnership Program-test</strong> page as the context. This
can be obtained by editing the Format and selecting the appropriate
Index Block and context page under the <strong>Preview
Format</strong> section</li>
</ul>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-07T13:38:46Z2015-10-07T13:38:46ZIncorrect path in submenus<div><p>Hi Ryan-</p>
<p>The files are attached for your reference> Thanks for the
help, really appreciate it.</p>
<p>Shruti</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T13:19:52Z2015-10-08T13:19:52ZIncorrect path in submenus<div><p>Thank you for attaching the files, Shruti.</p>
<p>Also, when you have a moment, please attach or paste the
expected HTML markup for the menu so I can get a better sense of
what you're looking for.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T13:38:56Z2015-10-08T13:38:56ZIncorrect path in submenus<div><p>Hi Ryan-</p>
<p>AU-mcc-partnership test is a folder under Nursing. If you look
at this page- <a href="http://stage.aurora.edu/woodstock/academics/adult-degree-completion-programs/nursing/au-mcc-partnership.html">
http://stage.aurora.edu/woodstock/academics/adult-degree-completion...</a><br>
The last item on left nav is the folder, without the index added at
the end. And when I click on it, I want it to be an active item and
stay in same left nav, rather create a new one like it does
now.<br>
I have attached the expected markup of left nav.<br>
Please let me know if this makes sense.</p>
<p>Thanks!<br>
Shruti</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T18:56:08Z2015-10-08T18:56:08ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>I spent most of the morning dissecting the Format and, honestly,
it's very difficult to follow. Specifically, if you debug the loops
the context variable is a mixture of page/folder elements as well
as metadata and system elements; also it's difficult to determine
what some of the macros do in general.</p>
<p>That being said, I retooled one of our example Formats and I
believe I was able to get the desired output. Note: you don't
currently have child pages within that active folder so it's
difficult to debug beyond that 3rd level, but I think it should
work. Give the following a try for starters:</p>
<pre>
<code>#*
* Macro for disaplying a node's link.
*
* For folders, output a link that goes to the folder's index page. Also, output
* additional markup for the link containing arrows based on the level.
*
* @param $node The current node to output
* @param $level The current nested level
*#
#macro ( showLink $node $level )
## Get node location
#set ( $nodeLoc = $node.getChild("link").value )
## Grab page "title"
#set ( $nodeTitle = $node.getChild("title") )
## Grab "display-name"
#set ( $nodeDisplayName = $node.getChild("display-name") )
#if ( $nodeDisplayName && $nodeDisplayName.value != "" )
#set ( $theTitle = $nodeDisplayName )
#elseif ( $nodeTitle && $nodeTitle.value != "" )
#set ( $theTitle = $nodeTitle )
#else
#set ( $theTitle = $node.getChild("name") )
#end
#if ($node.getName() == "system-folder")
#set ( $nodeLoc = "${nodeLoc}/index" )
#end
#set ( $activeClass = "" )
#if ($node.getAttribute('current'))
#set ( $activeClass = "class='active'" )
#end
<a href="${nodeLoc}" ${activeClass}>
#if ($node.getName() == "system-folder")
#if ($level == 1)
<div class="accnav_arrow_1">&#187;</div>
${_EscapeTool.xml($theTitle.value)}
#elseif ($level == 2)
<div class="accnav_arrow_2">&#187;</div>
<div class="lnav_name">${_EscapeTool.xml($theTitle.value)}</div>
#else
<div class="accnav_arrow_3">&#8226;</div>
<div class="lnav_name">${_EscapeTool.xml($theTitle.value)}</div>
#end
#else
${_EscapeTool.xml($theTitle.value)}
#end
</a>
#end
#*
* Macro for disaplying a folder's link and processing it's children
*
* @param $folder The current folder to output and process
* @param $level The current nested level
*#
#macro ( showFolder $folder $level)
#showLink($folder $level)
## Check for child pages, files, and folders (only want to continue processing folders that have the current page).
#set ( $subfolders = $_XPathTool.selectNodes($folder, "system-page[name!='index' and dynamic-metadata[name='left-nav']/value = 'Yes'] | system-folder[descendant::system-page[@current]] | system-symlink") )
#if ( $subfolders.size() > 0 )
#loopFolder($subfolders $_MathTool.add($level, 1))
#end
#end
#*
* Macro for recursively processing a given folder
*
* @param $theFolder Array of folder children
* @param $level The current nested level
* @param $customAttributes String of custom attributes that can be applied to the
unordered list.
*#
#macro ( loopFolder $theFolder $level $customAttributes)
## Check for assets
#if ( $theFolder.size() > 0 )
#set ( $listAttributes = "" )
#if ($customAttributes && $customAttributes != "")
#set ( $listAttributes = $customAttributes )
#end
#set ( $customAttributes = "" )
<ul ${listAttributes}>
## Loop through folder
#foreach ( $item in $theFolder )
<li>
## Check item type
#if ( $item.getName() == "system-page" )
#showLink($item)
#else
#showFolder($item $level)
#loopFolder($item $_MathTool.add($level,1))
#end
</li>
#end
</ul>
#end
#end
## Abstract out the "system-index-block" node
#set ( $sib = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block") )
## Gather "system-folder" containing containing current page.
#set ( $items = $_XPathTool.selectNodes($sib, "system-folder/system-folder[descendant::system-page[@current]]/system-folder") )
## Make the site map
#if ( $items.size() > 0 )
<nav class="subnav">
#loopFolder($items 1 'class="lnav subnav-list" id="left_nav"')
</nav>
#end</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T20:15:00Z2015-10-08T20:15:00ZIncorrect path in submenus<div><p>Thanks Ryan.<br>
Those were pretty much my difficulties as well. With current
script, I can no longer see the AU mcc folder under nursing.</p>
<p>I'll tweak a few things here and see what I can get.</p>
<p>Thanks so much, Ryan!</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T20:45:51Z2015-10-08T20:45:51ZIncorrect path in submenus<div><p>Not a problem at all, Shruti.</p>
<blockquote>
<p>With current script, I can no longer see the AU mcc folder under
nursing.</p>
</blockquote>
<p>Are you referring to the <code>au-mcc-partnership-test</code>
folder? If so, it's at the bottom of the nested menu. As I
mentioned, your Index Block did not contain any pages within that
folder so you won't see an additional menu under it.</p>
<p>Please let me know if you have any questions and keep me posted
on your findings.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-08T20:55:48Z2015-10-08T20:55:48ZIncorrect path in submenus<div><p>Okay.<br>
So does that mean I need to change the rendering behavior on index
block to a different option?<br>
If so, other options did not display it either.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-09T11:21:13Z2015-10-09T11:21:13ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>Can you confirm whether this folder contains additional pages
besides <code>index</code>? The sample XML you provided did not, so
my assumption is there are no other pages at this level in the menu
to display.</p>
<p>As I mentioned, once you create some more pages within that
folder the submenu should appear.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-09T14:10:22Z2015-10-09T14:10:22ZIncorrect path in submenus<div><p>No. I meant the folder(AU MCC Partnership test) that was at the
left nav bottom on this page here- <a href="http://stage.aurora.edu/woodstock/academics/adult-degree-completion-programs/nursing/index.html#.VhfHlSv3T6k">
http://stage.aurora.edu/woodstock/academics/adult-degree-completion...</a></p>
<p>It no longer appears. Nursing itself has various pages under it,
and they all show just fine(as you can see on the link above), AU
MCC partnesrship Test is one and only folder under nursing, and
that does not show anymore. :)</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-09T14:12:33Z2015-10-09T14:12:33ZIncorrect path in submenus<div><p>Here is the xml as well.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812015-10-09T17:31:47Z2015-10-09T17:31:47ZIncorrect path in submenus<div><p>Hi Shruti,</p>
<p>Looks like you will need to tweak the XPath on line 65 where
<code>showFolder</code> attempts to traverse it's children.
Specifically, the XPath is only looking for folders that have the
current page within it, which is why your folder isn't showing.</p>
<p>Try the following and let me know how it works out:</p>
<pre>
<code>#set ( $subfolders = $_XPathTool.selectNodes($folder, "system-page[name!='index' and dynamic-metadata[name='left-nav']/value = 'Yes'] | system-folder | system-symlink") )</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/379885812017-10-26T20:45:38Z2017-10-26T20:45:38ZIncorrect path in submenus<div><p>Hi Ryan-</p>
<p>I hope I am sending the email to the right person, I had posted a couple questions on formats forum but I haven't received much help, and you have always been able to fix things for us in past.<br>
So, I dug into my older emails to find a way to email you.</p>
<p>This is where I posted my question- <a href="https://help.hannonhill.com/hc/en-us/community/posts/115001929934-Nested-loops?page=1#community_comment_115001293693">https://help.hannonhill.com/hc/en-us/community/posts/115001929934-N...</a></p>
<p>I am unable to loop through various images in mini slider, getting only first image for each section. Could you PLEASE take a look?</p>
<p>Thanks so much,<br>
Shruti</p>
<p>-- Shruti Sargam Digital Communications Manager<br>
Aurora University<br>
(630) 844-4233 ssargam @aurora.edu</p>
<p>Discover what matters. And build your life around it.<br>
aurora.edu | facebook.com/aurorauniversity | twitter.com/aurorau</p></div>ssargam