Menu link outputs post id
-
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
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Menu link outputs post id’ is closed to new replies.