Show Article list from specific Date & Time on Home page by using API

3 Commentaires

  • Mia Jonson
    Actions pour les commentaires Permalien

    Hi!

    Is it possible to just show announcements in this list as well? And not the FAQ.

    0
  • Ifra Saqlain
    Actions pour les commentaires Permalien

    Hey Mia,

    Give me some time, I'll answer of your question:)

    Ifra

    0
  • Ifra Saqlain
    Actions pour les commentaires Permalien

    Hey,

    If you want to show the only Announcement with all their article list so please copy this code and paste on your home_page.hbs and remove that whatever I told before. 

     

    I imported the new Copenhagen theme and just modify the small code snippet. See in the given images.

     {{#each categories}}
    {{#if ../has_multiple_categories}}
    <li class="blocks-item">
    <a href='{{url}}' class="blocks-item-link">
    <span class="blocks-item-title">{{name}}</span>
    <span class="blocks-item-description">{{excerpt description}}</span>
    </a>
    </li>
    {{else}}
    {{#each sections}}
    {{#is id 360007760951}} //Here you need to update ID. Remove this given ID and add your Announcement section ID.
    <li class="blocks-item">
    <a href='{{url}}' class="blocks-item-link">
    <span class="blocks-item-title">
    {{name}}
    </span>
    {{#if articles}}
    <ul>
    {{#each articles}}
    <li>
    {{title}}
    </li>
    {{/each}}
    </ul>
    {{/if}}
    </a>
    </li>
    {{/is}}
    {{/each}}
    {{/if}}
    {{/each}}

     

     

    Before modifying the code:

     

    After modifying the code, I add the Announcement section ID and add code for article list:

     

    Let me know if any issue :)

     

    Thank You

    Team

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk