1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 $url variable in navigation template

Discussion in 'XenForo Questions and Support' started by Crazy-Achmet, Nov 12, 2015.

  1. Crazy-Achmet

    Crazy-Achmet Active Member

    Hey,

    is there any way i can use the $url variable in the navigation template? Please don't tell me i need custom development for that.

    Would be cool if there's a way i could use it in that template! :)

    Thanks a lot in advance

    Florian
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The $url variable related to what?

    What are you trying to do?
     
  3. Crazy-Achmet

    Crazy-Achmet Active Member

    I would like to add two buttons to my navbar

    One (only if i'm in thread_view) for an answer button and one button to share this page (but if i'm on page 2 of a thread the $url variable still contains just the thread url without the page parameter). That's where i need the $url
     
  4. Robust

    Robust Well-Known Member

    {xen:link 'route', 'anyadditionaldata'}

    e.g.
    {xen:link 'thread', $thread.thread_id}

    (format may be slightly wrong, been a while since I used xen:link in templates)
     
  5. Crazy-Achmet

    Crazy-Achmet Active Member

    $thread isn't available in the navbar template! Already tried that! ;)
     
  6. Robust

    Robust Well-Known Member

    Ah, missed the part where you mentioned what template. Could use an add-on to add to the view params and combine it with an if statement. I'd imagine there's an easier solution though, combination of an if statement and the URL route.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Crazy-Achmet and Robust like this.
  8. Robust

    Robust Well-Known Member

Share This Page