Skip to content

Parameters

Michael Witwicki edited this page Jan 13, 2017 · 26 revisions
Name Type Default
activeClass string active
activeClassOnAncestors boolean false
ancestorActiveClass string active
breadcrumbs boolean false
class string null
disableActiveClass boolean false
id string null
ignoreIncludeInNavigation boolean false
maxDepth integer 0
reverseNodes boolean false
skipDisabledEntries boolean false
startDepth integer 0
startWithActive boolean false
startWithAncestorOfActive boolean false
startWithChildrenOfActive boolean false
startWithChildrenOfNodeId integer 0
startWithNodeId integer 0
startWithSiblingsOfActive boolean false
startXLevelsAboveActive boolean false
wrapType string ul

activeClass

The class name you would like to associate with the active node.

'activeClass' : 'YOUR_ACTIVE_CLASS'

activeClassOnAncestors

Determines if you'd like to include an active class on the ancestors of the active node.

'activeClassOnAncestors' : true

ancestorActiveClass

The class name you would like to associate with the ancestors of your active node. Requires activeClassOnAncestors to be true.

'ancestorActiveClass' : 'YOUR_ANCESTOR_ACTIVE_CLASS_NAME'

breadcrumbs

Build breadcrumbs to the active node.

Example
{% set navConfig = {
    'breadcrumbs' : true,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1
        - Item 1.1.1
        - Item 1.1.2
            - Item 1.1.2.1
            - Item 1.1.2.2 (ACTIVE NODE)
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1
- Item 1.1
- Item 1.1.2
- Item 1.1.2.2 (ACTIVE NODE)

class

A class name which will be added to the outermost wrapper of your navigation.

'class' : 'YOUR_CLASS_NAME'

disableActiveClass

When set to true, no nodes will be given an active class.

'disableActiveClass' : true

id

An id which will be added to the outermost wrapper of your navigation.

'id' : 'YOUR_ID'

ignoreIncludeInNavigation

Each node has an optional "Include In Navigation" setting within the control panel. This parameter allows you to override the setting from within the node.

'ignoreIncludeInNavigation' : true

maxDepth

The maximum depth of a navigation from the root node.

'maxDepth' : 3

reverseNodes

Reverse the order of all nodes in a tree.

'reverseNodes' : true

skipDisabledEntries

Skip any nodes linked to entries which are disabled.

'skipDisabledEntries' : true

startDepth

The depth at which to start your navigation.

'startDepth' : 2

startWithActive

Start your navigation with the active node.

Example
{% set navConfig = {
    'startWithActive' : true,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1 (ACTIVE NODE)
        - Item 1.1.1
        - Item 1.1.2
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1.1 (ACTIVE NODE)
    - Item 1.1.1
    - Item 1.1.2
        - Item 1.1.2.1
        - Item 1.1.2.2
    - Item 1.1.3

startWithAncestorOfActive

Start your navigation with the root node of the branch in which the active node exists.

Example
{% set navConfig = {
    'startWithAncestorOfActive' : true,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1
        - Item 1.1.1
        - Item 1.1.2 (ACTIVE NODE)
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1
    - Item 1.1
        - Item 1.1.1
        - Item 1.1.2 (ACTIVE NODE)
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2

startWithChildrenOfActive

Start your navigation with the children of the active node.

Example
{% set navConfig = {
    'startWithChildrenOfActive' : true,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1 (ACTIVE NODE)
        - Item 1.1.1
        - Item 1.1.2
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1.1.1
- Item 1.1.2
    - Item 1.1.2.1
    - Item 1.1.2.2
- Item 1.1.3

startWithChildrenOfNodeId

Start your navigation with the children of the node id passed.

Example
{% set navConfig = {
    'startWithChildrenOfNodeId' : 99,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}

startWithNodeId

Start your navigation with the node id passed.

Example
{% set navConfig = {
    'startWithNodeId' : 99,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}

startWithSiblingsOfActive

Start your navigation with the siblings of the active node.

Example
{% set navConfig = {
    'startWithSiblingsOfActive' : true,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1 (ACTIVE NODE)
        - Item 1.1.1
        - Item 1.1.2
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1.1 (ACTIVE NODE)
    - Item 1.1.1
    - Item 1.1.2
        - Item 1.1.2.1
        - Item 1.1.2.2
    - Item 1.1.3
- Item 1.2

startXLevelsAboveActive

Start your navigation x levels above the active node.

Example
{% set navConfig = {
    'startXLevelsAboveActive' : 1,
} %}
{{ craft.navee.nav('mainNavigation', navConfig) }}
Full Navigation
- Item 1
    - Item 1.1
        - Item 1.1.1
        - Item 1.1.2 (ACTIVE NODE)
            - Item 1.1.2.1
            - Item 1.1.2.2
        - Item 1.1.3
    - Item 1.2
- Item 2
    - Item 2.1
    - Item 2.2
Result
- Item 1.1
    - Item 1.1.1
    - Item 1.1.2 (ACTIVE NODE)
        - Item 1.1.2.1
        - Item 1.1.2.2
    - Item 1.1.3
- Item 1.2

wrapType

When using craft.navee.nav() by default your nodes will be presented in an unordered list. If you'd like to override this with something like an ordered list, you can pass the wrapType parameter.

'wrapType' : 'ol'