• Resolved daniquilez

    (@daniquilez)


    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

    https://wordpress.org/plugins/timber-library/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author jarednova

    (@jarednova)

    Hi Dani,

    Thanks for the report. I’ve actually moved this over to GitHub where it’s easier to track progress and code changes (not to mention, get notifications which is why I didn’t respond sooner). You can follow that issue here…

    https://github.com/jarednova/timber/issues/276

    Plugin Author jarednova

    (@jarednova)

    @dani: which one of these calls are failing? is it…..

    <a href="{{item.link}}">{{item.title}}<span class="caret"></span></a>
    <li><a href="{{child.link}}">{{child.title}}</a></li>
    <a href="{{item.url}}">{{item.title}}</a>

    … is it one of these? two of these? or all of the above?

    Plugin Author jarednova

    (@jarednova)

    Hey @dani, thanks again for calling this to my attention. I have a fix and will push to WordPress.org (along with tons of other new stuff) tomorrow.

    Plugin Author jarednova

    (@jarednova)

    Marking as resolved

    Thread Starter daniquilez

    (@daniquilez)

    Hey jared,

    Thanks a lot for fixing this!
    For the future I’ll report and try to contribute via github.

    Once more, thanks for this great library.

    regards,

    dani

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Menu link outputs post id’ is closed to new replies.