Most Popular Articles on Home Page

10 Comentários

  • Vladan Jovic
    Community Moderator

    Hey Emma, here you go:

     {{#if promoted_articles}}
    <section class="articles">
    <h3>{{t 'promoted_articles'}}</h3>
    <ul class="article-list promoted-articles">
    {{#each promoted_articles}}
    <li class="promoted-articles-item">
    <a href="{{url}}">
    {{title}}
    </a>
    {{#if internal}}
    <span class="icon-lock" title="{{t 'internal'}}"></span>
    {{/if}}
    </li>
    {{/each}}
    </ul>
    </section>
    {{/if}}

    Just paste this code on the bottom of your HomePage template. After that, yes, you need to manually choose Promoted articles. Just edit an article and on the right side, you will see an option for that purpose. 

    Hope this helps!

     

    1
  • Emma MacDonald

    Hi Vladan! That does help, thanks!

    However, when I pasted in your code, the 'Promoted articles' section showed up twice. Once directly under the categories, and once in the bottom-left corner of the page. 

    Screenshot here: 

    and my help center url is help.loseit.com if that helps (though I've removed the code for now). 

    0
  • Emma MacDonald

    Okay, I might be totally misunderstanding. Do promoted articles automatically show on the help center home page? Because I removed the code, and one of them is still there! 

    0
  • Vladan Jovic
    Community Moderator

    Hey Emma, so the key is that promoted articles code was there already.

    If you have not marked any articles as promoted, nothing will show up there.

    Does it help?

    So you don't need my code there and you just need to flag one or more articles as promoted.

    Let me know if this doesn't help! 

     

    0
  • Emma MacDonald

    Hi Vladan,

    Yes that's correct I guess! I didn't realize they were set to automatically show up in the Copenhagen theme. Sorry about that!

    On a related note, do you know if there is a way to change the name of the section from promoted articles to something else, using the existing code? I tried changing this code to something else, and it just made the title disappear. :( 

     <h3>{{t 'promoted_articles'}}</h3>
    0
  • Vladan Jovic
    Community Moderator

    You are on the right way, here is how the new title should look:

     <h3>My new title here</h3>
     
    0
  • Emma MacDonald

    Perfect! Thank you!! Your tips have been saving my life recently! 

    1
  • Vladan Jovic
    Community Moderator

    You are welcome! I'm happy if I can help you again! 

    0
  • Victoria Reggiardo

    Hi Vladan Jovic

    Do you know if it is possible to automatically create the list of Popular articles based on the most viewed articles?

    2
  • Brett Bowser
    Zendesk Community Team

    Hey Victoria,

    I did some digging and it doesn't look like there's a popular articles helper available to pull this information. The closest helpers we have are recent_articles and recent_activities.

    It may be possible to display the most viewed articles but this would require some custom JS on your end to pull this information. Perhaps other users can jump in here and offer up some alternative solutions for you.

    I hope this points you in the right direction!

    0

Por favor, entrar para comentar.

Powered by Zendesk