Most Popular Articles on Home Page

8 Comentarios

  • Vladan Jovic

    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!

     

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

    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

    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

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

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk