Display article on homepage

2 Commentaires

  • 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. 

    0
  • 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>
    {{/is}}
    {{/each}}

    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>
    {{/is}}
    {{/each}}
    {{/each}}
    {{/each}}

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

    Hope that helps!

    Jim

    Zenplates - Custom themes, plugins and apps for Zendesk

     

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk