M2_Content_Util::hier2ul($hier, $options)
This will take the output from M2_Content::getTree() and turn
it into an unordered HTML list (<ul>
) suitable
for creating a navigation or any other hierarchical representation
of the data.
All nodes on the tree will be turned into HTML links, with a few exceptions, described in the options table.
$hier
is the M2_Content::getTree() output,
and the $options
are described below:
Table 29. Options for M2_Content_Util::hier2ul
Option | Description |
---|---|
rootClass | A HTML class added to the root
|
currentNodeID | The ID of the current node. If set, this node will not be an HTML link. |
urlField | The field in the type that should be used to
generate the URL for the link. You must choose between
using this option, or the |
titleField | The field in the type that should be used to generate the anchor text. |
urlPrefix | A string to prefix all links. |
urlTemplate | A template to generate the links, in which
you can use the placeholder |
type | One of the following:
|
firstRootIsFrontpage | For CMS purposes. If set to
|
parentsAreEmptyLinks | For CMS purposes. If set to
|