Display article on homepage

2 댓글

  • Devan - Community Manager
    Zendesk Community Team

    Hello Chris Whitley,

    You can restrict access to Guide articles by limiting permission on who can view any article of your choosing. This article goes into detail on how to restrict visible access to article content within your help center. 

    Setting view permissions on articles with user segments

    Best regards. 

  • Jim Davenport

    Hi Chris Whitley

    If you're generating the link dynamically using the templating system (and not just adding HTML to the page) it should respect the user segment setting.

    Assuming you want to show only a single article there are a couple of ways to render the article link using the properties available on the page (and without any custom JavaScript):

    Loop through promoted articles

    {{#each promoted_articles}}
    {{#is id 1234566789}}
    <a href="{{url}}">{{title}}</a>

    Where 123456789 is the ID of the article you want to display.  Alternatively, if the article is not promoted:

    Loop through categories, sections and articles

    {{#each categories}}
    {{#each sections}}
    {{#each articles}}
    {{#is id 123456789}}
    <a href="{{url}}">{{title}}</a>

    The first option would be the best, as Zendesk recommend not having too many of these superfluous loops in your templates.

    Hope that helps!


    Zenplates - Custom themes, plugins and apps for Zendesk



댓글을 남기려면 로그인하세요.

Zendesk 제공