am-impact / amnav

Navigation plugin for Craft
168 stars 20 forks source link

Expose getNavigations #34

Closed adamazing closed 9 years ago

adamazing commented 9 years ago

Exposes getNavigations for use via craft-lj-dynamicfields. Allows a user to select which menu to use within a sidebar, e.g. the following twig code can be added to a "Dropdown (dynamic)" field-type's options:

{% for nav in craft.amNav.getNavigations() %}
    { "value": "{{ nav.handle }}", "label":"{{ nav.name }}" }
    {% if not loop.last %},{% endif %}
{% endfor %}

Signed-off-by: Adam Henley adamazing@gmail.com

adamazing commented 9 years ago

I looked at adding a custom field type within the plugin but don't have the time to spare; feel free to reject this if you want it done the Right Way ;) This was just a quick change that helped me out with #33 and didn't seem too obtrusive.

adamazing commented 9 years ago

No longer needed. Thanks!