Wayfinder ver. 2.0
Wayfinder is a list builder for the CMF MODx. With a completely customizable layout, Wayfinder can be used to output a list, a table, a definition list, and just about anything else you could imagine. All of the menus for this site use the Wayfinder snippet. Wayfinder is included with the default install of MODx and will let you easily create any menu you might need.
Parameters
- &startId
- default: the current document id
- values: [ 0 | a document id | [*parent*] | [*id*] ]
- description: The startId parameter determines where Wayfinder should start processing the output. All documents contained within the startId will be processed. For a menu to start from the root of the site the startId should be set to 0.
- &level
- default: 0
- values: [ 0 | number ]
- description: The level parameter determines how deep into the tree structure Wayfinder will process. If set to 0, Wayfinder will process all levels of the document tree.
- &includeDocs
- default: 0
- values: [ comma-delimited list of document ids ]
- description: Acts as a filter and will limit the output to only the documents specified in this parameter. The startId is still required.
- &excludeDocs
- default: 0
- values: [ comma-delimited list of document ids ]
- description: Acts as a filter and will remove the documents specified in this parameter from the output. The startId is still required.
- &ignoreHidden
- default: FALSE
- values: [ TRUE | FALSE ]
- description: The ignoreHidden parameter allows Wayfinder to ignore the display in menu flag that can be set for each document. With this parameter set to TRUE, all documents will be displayed regardless of the Display in Menu flag.
- &ph
- default: FALSE
- values: name of placeholder
- description: To display send the output of Wayfinder to a placeholder set the ph parameter equal to the name of the desired placeholder. All ouput including the debugging (if on) will be sent to the placeholder specified.
- &debug
- default: FALSE
- values: [ TRUE | FALSE ]
- description: With the debug parameter set to TRUE, Wayfinder will output information on how each document was processed.
- &hideSubMenus
- default: FALSE
- values: [ TRUE | FALSE ]
- description: The hideSubMenus parameter will remove all non-active submenus from the Wayfinder output if set to TRUE. This parameter only works if multiple levels are being displayed.
- &removeNewLines
- default: FALSE
- values: [ TRUE | FALSE ]
- description: Wayfinder will automatically add line breaks into the generated output for increased code readability. To remove these line breaks set this parameter to FALSE.
- &textOfLinks
- default: menutitle
- values: [ id | menutitle | pagetitle | introtext | menuindex | published | hidemenu | parent | isfolder | description | alias | longtitle | type | template ]
- description: The field specified in the textOfLinks parameter will be inserted into the placeholder [+wf.linktext+].
- &titleOfLinks
- default: pagetitle
- values: [ id | menutitle | pagetitle | introtext | menuindex | published | hidemenu | parent | isfolder | description | alias | longtitle | type | template ]
- description: The field specified in the titleOfLinks parameter will be inserted into the placeholder [+wf.title+].
- &rowIdPrefix
- default: FALSE
- values: name of prefix
- description: If this parameter is set, Wayfinder will replace the placeholder [+wf.id+] with a unique id consisting of the specified prefix plus the document id.
- example: &rowIdPrefix=`topMenu` will output the following for doc # 29: id="topMenu29"
- &useWeblinkUrl
- default: TRUE
- values: [ TRUE | FALSE ]
- description: If weblinks are used in the output, Wayfinder will output the link specified in the weblink instead of the normal MODx link. To use the standard display of weblinks (like any other document) set this to FALSE.
- &showSubDocCount
- default: FALSE
- values: [ TRUE | FALSE ]
- description: The showSubDocCount parameter, if set to TRUE, will insert the number of documents in each folder into the placeholder [+wf.subitemcount+]
- &sortOrder
- default: ASC
- values: [ ASC | DESC ]
- description: Allows the menu to be sorted in either ascending or descending order.
- &sortBy
- default: menuindex
- values: [ id | menutitle | pagetitle | introtext | menuindex | published | hidemenu | parent | isfolder | description | alias | longtitle | type | template | random ]
- description: The sortBy parameter allows the output to be sorted by any of the above fields on a level by level basis. This means that each submenu will be sorted independently of all other submenus at the same level. Random will sort the output differently every time the page is loaded if the snippet is called uncached.
- &limit
- default: 0
- values: numeric value
- description: The limit parameter causes Wayfinder to only process the number of items specified per level.
- &displayStart
- default: FALSE
- values: [ TRUE | FALSE ]
- description: The displayStart parameter will cause Wayfinder to output the document used as the startId using the template startItemTpl. This parameter only works if the startId is not equal to zero. This functionality was added so that it is easy to add header to submenus.
Template Chunks
- &outerTpl
- default: see example
- values: name of template chunk
- description: The outerTpl template is used as the outer most wrapper for the generated ouput. All documents and folders will be processed and inserted into the [+wf.wrapper+] placeholder. If no innerTpl is specified the outerTpl is used when creating submenus.
- available placeholders:
[+wf.classes+] - where classes specifed will be inserted (includes class=" ")
[+wf.classnames+] - outputs the just the class names (without class=" ")
[+wf.wrapper+] - where inner content will be inserted- example:
<ul id="topnav"[+wf.classes+]> [+wf.wrapper+] </ul>
- example:
- &rowTpl
- default: see example
- values: name of template chunk
- description: The rowTpl template is used to output each document, folder, or weblink (unless one of the templates below is used). Any submenus processed will be inserted into the [+wf.wrapper+] placeholder.
- available placeholders:
[+wf.classes+] - where classes specifed will be inserted (includes class=" ")
[+wf.classnames+] - outputs the just the class names (without class=" ")
[+wf.link+] - the href value for your link
[+wf.title+] - text for the link title
[+wf.linktext+] - text for the link display
[+wf.wrapper+] - where to insert a submenu
[+wf.id+] - where to insert unique id
[+wf.attributes+] - where to insert link attributes
[+wf.docid+] - the document identifier for the current item
[+wf.subitemcount+] - displays the number of items in a folder
[+wf.description+] - output the description field
[+wf.introtext+] - output the introtext field- example:
<li[+wf.id+][+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a> [+wf.wrapper+] </li>
- example:
- &parentRowHereTpl
- default: NULL
- values: name of template chunk
- description: The parentRowHereTpl template is used when the current item is displayed in the menu, it is a folder, and the folders children are displayed in the menu. If the current item has children but they are not displayed in the menu this template will not be used.
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]»</a> [+wf.wrapper+] </li>
- &parentRowTpl
- default: NULL
- values: name of template chunk
- description: The parentRowTpl template is used when processing items that are folders with their children being displayed in the menu.
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]»</a> [+wf.wrapper+] </li>
- &hereTpl
- default: NULL
- values: name of template chunk
- description: The hereTpl template is used when the current item is displayed in the menu.
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <span>[+wf.linktext+]</span> [+wf.wrapper+] </li>
- &innerTpl
- default: NULL
- values: name of template chunk
- description: The innerTpl template is used as a wrapper for each submenu. If no innerTpl is specified the outerTpl is used in its place. Each item processed in the submenu will be inserted into the placeholder [+wf.wrapper+].
- available placeholders: Same as OuterTpl.
- example:
<ul[+wf.classes+]> [+wf.wrapper+] </ul>
- &innerRowTpl
- default: NULL
- values: name of template chunk
- description: The innerRowTpl template allows for a different template for all items processed that have a level great then one (any item inside a folder).
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a> [+wf.wrapper+] </li>
- &innerHereTpl
- default: NULL
- values: name of template chunk
- description: The innerHereTpl template is used when the current item is displayed in the menu and the item has a level greater than one (is in a folder).
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <span>[+wf.linktext+]</span> [+wf.wrapper+] </li>
- &activeParentRowTpl
- default: NULL
- values: name of template chunk
- description: The activeParentRowTpl template is used on the parent, grandparent, etc.. of the current item. The template is applied all the way up the document tree.
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a> [+wf.wrapper+] </li>
- &categoryFoldersTpl
- default: NULL
- values: name of template chunk
- description: The categoryFoldersTpl is used when the item is a folder, and either has the template set to blank or has rel="category" in the link attributes field. The children of the item must be displayed for this template to be used as well.
- available placeholders: Same as RowTpl.
- example:
<li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a> [+wf.wrapper+] </li>
- &startItemTpl
- default: see example
- values: name of template chunk
- description: The startItemTpl is used for templating the startId document when the parameter &displayStart is set to TRUE.
- available placeholders: Same as RowTpl.
- example:
<h2>[+wf.linktext+]</h2>[+wf.wrapper+]
- Template Processing Order
-
- startItemTpl
- parentRowHereTpl
- innerHereTpl
- hereTpl
- activeParentRowTpl
- categoryFoldersTpl
- parentRowTpl
- innerRowTpl
- rowTpl
Class names to be assigned
- &firstClass
- default: NULL
- values: name of class
- description: The firstClass will be applied to the first item displayed for each level.
- &lastClass
- default: last
- values: name of class
- description: The lastClass will be applied to the last item displayed for each level.
- &hereClass
- default: active
- values: name of class
- description: The hereClass will be applied to the current item and to each parent up the document tree.
- &selfClass
- default: NULL
- values: name of class
- description: The selfClass will be applied to the current item only.
- &parentClass
- default: NULL
- values: name of class
- description: The parentClass will be applied to each item that has children (is a folder).
- &rowClass
- default: NULL
- values: name of class
- description: The rowClass will be applied to each item being displayed.
- &levelClass
- default: NULL
- values: name of class
- description: The levelClass will be applied to each item denoting each items level, the level number will be added to the specified class (i.e. level1, level2, level3, etc...)
- &outerClass
- default: NULL
- values: name of class
- description: The outerClass will be applied to the outerTpl container.
- &innerClass
- default: NULL
- values: name of class
- description: The innerClass will be applied to the container used in the innerTpl.
- &webLinkClass
- default: NULL
- values: name of class
- description: The webLinkClass will be applied to all weblinks included in the output.
CSS & Javascript to include with menu
- &cssTpl
- default: FALSE
- values: name of CSS chunk
- description: The cssTpl allows for a chunk containing a link to a style sheet or style information to be inserted into the head section of the generated page.
- &jsTpl
- default: FALSE
- values: name of Javascript chunk
- description: The jsTpl parameter allows for a chunk containing some Javascript to be inserted into the head section of the generated page.