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

XF 1.2 Find out if this page represents a 404 or 403

Discussion in 'XenForo Questions and Support' started by rellek, Aug 18, 2013.

  1. rellek

    rellek Well-Known Member


    is there an easy way to find out if a page a 404 or 403 message? I'd like to make an exception in the templates (if cond1 and cond2 and not 404 and not 403 then display something).

    Thanks :)
  2. Mike

    Mike XenForo Developer Staff Member

    I don't believe that's exposed at the template level.
  3. rellek

    rellek Well-Known Member

    Okay... Could one find out if the current page represents an error (like any error) then?
  4. rellek

    rellek Well-Known Member

    Okay, I think I found a solution.

    This seems to work. Question: Is there anything wrong with this?

    <xen:if is="strpos({xen:raw $contents}, 'errorOverlay')">
    This only appears only if there's an error...

Share This Page