How can I display an article or section in multiple sections or categories?

Return to top

12 Comments

  • Yoni Hubermann

    I am trying to use the syntax below in a category template, unsuccessfully. I am unsure where in the page HTML, I should place it. Can someone share an example?

    {{#is category.id ######}}
    <a href="https://help center section URL without the title">alt text</a>
    {{/is}}
    0
  • Rad
    Zendesk Customer Care
    Hi Yoni,
     
    It looks like my colleague is already working with you on a ticket with the same query. Please respond to the existing ticket 😊️
     
    Thank you.
    0
  • Mike Averto

    Is it possible to access the "category" object on an "article" page template?

    {{#is category.name 'Sales'}}
    // will do something
    {{/is}

    I keep getting errors in the code editor saying I can't access "category". Is there a workaround for this?

    1
  • Bryan Funk

    This does not work.

    0
  • Nicole Saunders
    Zendesk Community Manager

    Hi Bryan, 

    Can you provide any additional detail about what you're seeing, what you've tried, etc? We aren't sure how to help troubleshoot without a little more info. 

    0
  • Heather Firth

    How can I reference two ids to use the same image? This doesn't work and I don't know the right syntax.

    <!--2022-->
    {{#is id 1##### 2#####}}
    <img src="{{asset '2022.png'}}"/>
    </a>
    {{is}}

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey, Heather Firth !

    The #is helper only allows for two parameters to be present so to have two separate IDs reference the same image, you’ll just need to split the IDs in to two separate #is statements:

    {{#is id 1##### }
    <img src="{{asset '2022.png'}}"/>
    {{is}}
    {{#is id 2##### }
    <img src="{{asset '2022.png'}}"/>
    {{is}}

    I hope this helps! Let me know if you have any questions.

    Tipene

    0
  • Derek Hixon

    I was able to add an article to a section ok, however, the article doesn't show up on the category page so am now trying to also add the article to the section on the category page and am using the below code.

    Is this correct, and more importantly, where would I place this? Thanks!

    {{#is id 123fake_section_id_123}}
    <li>
    <a href="https://mycompany.zendesk.com/hc/en-us/articles/12345678910">Article Text</a>
    </li>
    {{/is}}
    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hi Derek Hixon,

    The code looks good to me! You'll want to place that in the category_page.hbs file within the {{each #sections}} helper, which sits below the div with the ID "main-content".

    0
  • Derek Hixon

    Thanks Tipene Hughes all set now, cheers!

    0
  • Rachel Miller

    hi! 

    We are trying to display one article across several sections in Zendesk. We're using this community article to add code to our theme. 

    We successfully got an article to show up under another section in our zendesk sanbox tenant (see attached), but we can't get the article to also show up on the category page under that section.


    Test Case

    Original Article Placement:
    - Category:Working at Twitch
    - Section: Recruiting

    DUPLICATE SHOWINGS using Code

    On Section Page - SUCCESS:
    - Category: Manager Toolkit
    - Section: **Create and Manage Headcount
    Added the following code to section_page.hbs, line 48:
    {{#is 360010025532}}<a href="https://twitchpeople1568844680.zendesk.com/hc/en-us/articles/360048464891">Who is my Recruiter?</a>
    {{/is}}

    Under Section on Category page - FAIL
    Added the following code to line 44 of the category_page.hbs
    {{#is id 1568844680}}
    <a href="https://twitchpeople1568844680.zendesk.com/hc/en-us/articles/360048464891">Who is my Recruiter?</a>
    {{/is}}

     

    TL;DR: The code successfully made the article appear on the category page but not under a section, we want it to appear under create and manage headcount. It does appear there when you open that section page.

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Rachel! To see what might be going on, I'll need to take a look at your account. I'll open up a private ticket so that we can continue this discussion without sharing any account info here. Talk to you shortly!

    0

Please sign in to leave a comment.

Powered by Zendesk