Linking categories to external urls in the "Copenhagen theme"

Answered

2 Comments

  • Simon Celen

    Hi Andreas,

    This can't be done by default but you could customize your theme and use Javascript to override the category URL. If you're unfamiliar with editing your theme you can read the relevant primer in the Zendesk documentation.

    Assuming a stock Copenhagen theme, you can follow these steps:

    1. Edit your home_page.hbs template and add an ID attribute to the category links:

      <a href='{{url}}' class="blocks-item-link" id="cat-{{id}}">
    2. Edit the scripts.js file and add the following:

      // CUSTOM: override category links
      document.getElementById('cat-0123456789').href = 'https://www.google.com';
      Replace the 0123456789 number with the correct category ID. You can find the ID in the URL when on the category page.

     

    Let me know how it works out.


    Thanks,

    Simon

    1
  • Andreas Ribbfors

    Terrific Simon, it works like a charm!


    Thanks a lot!

    1

Please sign in to leave a comment.

Powered by Zendesk