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

<xen:if clause in a template

Discussion in 'XenForo Questions and Support' started by middlewingnut, Oct 11, 2012.

  1. middlewingnut

    middlewingnut Member

    Hi All,

    I just can't get this to work - I want to do something based on the current url. So far I have:

    <xen:if is={$requestPaths.requestUri} == '/index.php?pages/homepage/'>
    My HTML
    When I go to save the template, I get an error...
  2. middlewingnut

    middlewingnut Member

    My bad - just a bit more searching would have given me the answer: My 'if' statement needs to be quoted:

    <xen:if is="{$requestPaths.requestUri} == '/index.php?pages/homepage/'">

    is working for me.

    Next question: where do I find a list of the variables available to me?
    Jake Bunce likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. middlewingnut

    middlewingnut Member

    Thanks Jake,
    I've been busy at the coal-face. Loving xenforo, but I apologise for hacking an AJAX script into to to give me the dynamic pages I needed...

    ... I think I could have done it with a callback, but couldn't manage it as smoothly as I wanted.

    (I'll leave that for another thread)

Share This Page