-
-
Notifications
You must be signed in to change notification settings - Fork 512
Closed
Labels
needs-investigationWe've got all the info, now someone needs to look into this to figure out what's going onWe've got all the info, now someone needs to look into this to figure out what's going on
Description
This came in from WP.org forums:
https://wordpress.org/support/topic/menu-link-outputs-post-id?replies=1
Hello!
First of all thanks for this library. I just started 1 week ago my first wordpress project. I was using silverstripe before. Timber offers great structure and functionality!
My question: Why when I use TimberMenu I receive always numeric id from post as link. I'll like to use the permalink like: http://mysite.domain/my-slug. Instead I receive always id like for example http://mysite.domain/2.
Here is the twig code:
<ul class="nav navbar-nav">
{% for item in menu.get_items %}
<!-- class active for active -->
<li {% if item.get_children %}class="dropdown"{% endif %}>
{% if item.get_children %}
<a href="{{item.link}}">{{item.title}}<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
{% for child in item.get_children %}
<li><a href="{{child.link}}">{{child.title}}</a></li>
{% endfor %}
{% else %}
<a href="{{item.url}}">{{item.title}}</a>
{% endif %}
{% endfor %}Is there something I'm missing in the documentation?
Thanks in advance!!
dani
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-investigationWe've got all the info, now someone needs to look into this to figure out what's going onWe've got all the info, now someone needs to look into this to figure out what's going on