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

XF 404 page

Discussion in 'XenForo Questions and Support' started by Ryan Kent, Jun 1, 2011.

  1. Ryan Kent

    Ryan Kent Well-Known Member

    If you try to access a non-existant page on a XF site you get a message that says:

    XenForo Community - Error

    The requested page could not be found.
    I located the phrase "requested_page_not_found" and would like to replace it with the following:
    Oops! We seem to have misplaced the page you seek.

    You can press the Back button on your browser, or return to our forums by clicking here

    Two questions:

    1. It seems bbcode isn't accepted in a phrase. What's the best alternate?

    2. Is there a way to say {site}/forums that way the phrase can be used without adjustment on other XF sites?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can use HTML in phrases.

    Try using <a href="{xen:link 'forums/'}"> for the URL.

    Edit: Just tried using the above and it doesn't work. You need to use standard HTML, like so:
    <a href="/community">Forum</a>
     
  3. Mike

    Mike XenForo Developer Staff Member

    In a phrase, you can't use {xen:link} or any template syntax (or any variables that aren't exposed to the phrase). You'll have to use the direct URL.
     
  4. Ryan Kent

    Ryan Kent Well-Known Member

    Thank you both Mike and Brogan for the guidance.

    I modified my "requested_page_not_found" as indicated below. I also modified the "requested_thread_not_found" but replaced "." with "/forum".

    I would offer the recommendation this change would be beneficial to everyone and you may want to consider it for the default XF phrase.

    <h2>Oops! It looks like we misplaced the page you want. </h2>

    <h1>You can press the Back button on your browser, or return to our home page by clicking <a href=".">Home</a></h1>
     
    TheLaw likes this.
  5. murat çabuk

    murat çabuk New Member

    how can we add here seach form ?
     
  6. Tracy Perry

    Tracy Perry Well-Known Member

    Or you can simply look at this add-on. :D
     
  7. murat çabuk

    murat çabuk New Member

    if we can show search form on 404 pages google will love it..
     
  8. Tracy Perry

    Tracy Perry Well-Known Member

    Pretty sure since it's a template use for that add-on, adding it into the template would not be that difficult. Not something I've really tried since the default mysql search sucks so bad.
     
  9. adwade

    adwade Active Member

Share This Page