Can I edit the error page in Help Center?

Return to top
Have more questions? Submit a request

11 Comments

  • Sarah Driver

    How can you edit the text that appears as a result of the inclusion of e.g. {{t 'nonexistent_page'}}? Is it possible?

    0
  • Trapta
    Community Moderator

    Hi @Sarah,

    You can simply replace the component with TEXT you want to show so that, your code will look like <h2>TEXT</h2> from <h2>{{t 'nonexistent_page'}}</h2>.

    If you are on Professional or Enterprise plan then, you can also use dynamic content in place of TEXT.

    Thanks

    0
  • Robert

    I have a Swedish Zendesk. Am I not able to edit the text at the root? I.e. go to the place where the "nonexistent_page" variable and the "mistyped_adress_or_moved_page" variable are defined and edit their texts there? 

    Our current text is not optimal. 

    0
  • Devan - Community Manager
    Zendesk Community Team

    Hello Robert,

    You should be able to edit this as well on your en by navigating via the following route. 

    guide manager > themes > select the theme to edit > edit code > error_page.hbs

    I've also included an article that goes into detail on how to make changes to your Help Center.

    Customizing your Help Center

    Best Regards!

    0
  • Robert

    But my error_page.hbs looks like the code below. Where do I edit the "<p>{{t 'mistyped_address_or_moved_page'}}</p>? i.e. the content of mistyped_address_or_moved_page?

     

    <div class="container-divider"></div>
    <div class="error-page">
    <h1>{{t 'oops'}}</h1>

    {{#is error 'unauthorized'}}
    <h2>{{link 'sign_in'}}</h2>
    {{/is}}

    {{#is error 'forbidden'}}
    <h2>{{t 'not_authorized'}}</h2>
    {{/is}}

    {{#is error 'not_found'}}
    <h2>{{t 'nonexistent_page'}}</h2>
    <p>{{t 'mistyped_address_or_moved_page'}}</p>
    {{/is}}

    {{#link 'help_center'}}
    {{t 'back_to_homepage'}}
    {{/link}}
    </div>

    0
  • Sebastiaan Wijchers
    Community Moderator

    Hello Robert,

    You cannot change the value/translation of mistyped_address_or_moved_page, so if your help center is just Swedish, I would just replace the whole '{{t 'mistyped_address_or_moved_page'}}' part with a text of your liking.

    With kind regards,

    Sebastiaan
    Sparkly ⭐

    P.S.
    In case you need a 'translatable' value, let me know. Then I'll propose another solution.

    0
  • Thomas Crowley

    Hi, can I display a different error page based on user role?

    So some form of "IF User_Role = Anonymous... ELSE..."

    0
  • Dan Ross
    Community Moderator

    Hey Thomas,

    You should be able to. Here's a Zendesk article on how to hide/show content based on roles. 

    Hope that helps!

    0
  • Thomas Crowley

    Thanks Dan! I managed to work that bit out. The content I want to show is a link to a search for the same article on a different wiki (we're trying to compare and consolidate, so I want to add the link to help us switch between the two quickly without manually having to look up the other article).

    I tried `<a href=https://{URL}/wiki/search?&type=page&title=true&text={{article.title}}>`, but it retains the spaces in the {{article.title}}, so the link only includes the first word of the title. I can't use {{article.slug}} or add `url_encode` or anything to the object.

    Is there a way to do this? Could I assign the value of the {{article.title}} to a variable and url-encode that?

    0
  • Simon Celen
    Community Moderator

    Hi Thomas,

    As you've discovered there's no {{article.slug}} or {{url_encode}}. You're right that assigning to a variable is the way to go.

    In your article_page.hbs template you could add f.e.:

    <script type="text/javascript">
    var article_title = {{json_stringify article.title}}; // json_stringify to avoid quoting issues
    </script>

    ...then in your scripts.js file:

    $(document).ready(function() {
    $('a#your_wiki_search_link').attr('href', function(i, existing_href) {
    return existing_href + '&text=' + encodeURIComponent(article_title);
    });
    });

    Note that just appending "&text=" like that is a naive approach to modifying URLs. There are Javascript libraries out there to do it properly but that's out of scope for this comment.

    Hope that helps!

    1
  • Thomas Crowley

    Thanks for the reply Simon, that did the job. Cheers.

    0

Please sign in to leave a comment.

Powered by Zendesk