verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

node.linkAttributes method missing from the docs? #246

Closed thijskaspers closed 3 years ago

thijskaspers commented 3 years ago

You can render custom nodes and use this handy public linkAttributes method for the link attributes like href/target/class, etc.:

<li>
    <a {{ node.linkAttributes }}>
        {{ node.title }}
        <span class="icon icon-angle-down"></span>
    </a>
</li>

There is as far as I've seen no mention of this in the docs though? See: https://verbb.io/craft-plugins/navigation/docs/developers/node

It shows link for the full link, or customAttributes, but not linkAttributes.

engram-design commented 3 years ago

Yep, just an undocumented feature, but here to stay! I believe it might've even been added as a PR. Added to the docs

thijskaspers commented 3 years ago

Thanks! Should it be added to the table above too? customAttributes is in it, but listAttributes isn't: https://verbb.io/craft-plugins/navigation/docs/developers/node#attributes