#* 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)
  • #if ($arrow == 2)
    »
    $_SerializerTool.serialize($node.getChild('display-name'), true) #elseif ($arrow == 1)
    #elseif ($arrow == 0)
    »
    #end
  • #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')
  • #set ($href = $program.getChild('path').value + "/index")
    »
  • #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)