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

Route Filters and xen:link

Discussion in 'XenForo Development Discussions' started by AndyB, Dec 29, 2013.

  1. AndyB

    AndyB Well-Known Member

    In my add-on called Calendar, I have a temple with this line of code using the xen:link

    Code:
    <form action="{xen:link 'threads/calendar/', $thread}" method="get" data-redirect="on">
    
    As you can see the 'threads/calendar/' part requires the URL to have "threads" be part of the route. If a forum is using Route Filters, the "threads" part of the URL might be changed to something else.

    Is there a way around this problem? It would seam that I would need to be able to determine if there is a Route Filter and if there is, what has "threads" been substituted with.

    Thank you for any assistance.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    There is no problem here.

    Try it yourself. Change your "threads" route to "discussions". Any link built using {xen:link will pick up and apply that change.
     
  3. AndyB

    AndyB Well-Known Member

    Thank you for the correction, Chris.

    As you stated, there is no problem at all and the code example in post #1 works perfectly.
     

Share This Page