Display all articles on category page

Respondida

11 Comentários

  • Tom Matthews

    Have there been any updates on the ability to display all articles in a section on the category page yet, rather than having the link that says "See all X articles"?

    Currently this is my category page category_page.hbs.

    <div id="main-content" class="section-tree">
            {{#each sections}}
              <section class="section">
                <h2 class="section-tree-title">
                  <a href="{{url}}">{{name}}</a>
                </h2>
                {{#if articles}}
                  <ul class="article-list">
                    {{#each articles}}
                      <li class="article-list-item{{#if promoted}} article-promoted{{/if}}">
                        {{#if promoted}}
                          <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" focusable="false" viewBox="0 0 12 12" class="icon-star" title="{{t 'promoted'}}">
                            <path fill="currentColor" d="M2.88 11.73c-.19 0-.39-.06-.55-.18a.938.938 0 01-.37-1.01l.8-3L.35 5.57a.938.938 0 01-.3-1.03c.12-.37.45-.63.85-.65L4 3.73 5.12.83c.14-.37.49-.61.88-.61s.74.24.88.6L8 3.73l3.11.17a.946.946 0 01.55 1.68L9.24 7.53l.8 3a.95.95 0 01-1.43 1.04L6 9.88l-2.61 1.69c-.16.1-.34.16-.51.16z"/>
                          </svg>
                        {{/if}}
                        <a href="{{url}}" class="article-list-link">{{title}}</a>
                        {{#if internal}}
                          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" focusable="false" viewBox="0 0 16 16" class="icon-lock" title="{{t 'internal'}}">
                            <rect width="12" height="9" x="2" y="7" fill="currentColor" rx="1" ry="1"/>
                            <path fill="none" stroke="currentColor" d="M4.5 7.5V4a3.5 3.5 0 017 0v3.5"/>
                          </svg>
                        {{/if}}
                      </li>
                    {{/each}}
                  </ul>
                  {{#if more_articles}}
                    <a href="{{url}}" class="see-all-articles">
                      {{t 'show_all_articles' count=article_count}}
                    </a>
                  {{/if}}
                {{/if}}
              </section>
            {{else}}
              <i class="category-empty">
                <a href="{{category.url}}">{{t 'empty'}}</a>
              </i>
            {{/each}}
          </div>
    1
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Cris,

    Bydefault 'See all articles' link shows when  your section have more than 6 articles. I saw your category page , sections haven't more than 6 articles.

    You can see in the given image - FAQ section have more than 6 articles so See all articles link  is being show  but Announcement section have only 3 articles that's why See all articles link isn't being show.

     

    By this CSS property you can show only 3 articles in your section on category page. When you add this property  only 3 articles will be show.

     

    Copy this code and paste on your style.css template .

    .category-content .section-tree .article-list-item:nth-child(2n+2){
    display:none;
    }

     

     

    See the result:

    I did it on Copenhagen theme.

     

    Thank you 

    Team Diziana

     

    0
  • Trapta Singh
    Community Moderator

    Hi @..., try looking at {{section_tree_with_article}} helper. It will show all the 30 articles in the section. However, there is a restriction on showing all articles in a section but this hack will increase the number of articles to be shown per section for you.

    Let me know if this helps.

    Thanks

    0
  • Chris Whitley

    Thank you both, this is resolved now. A previous piece of code used to display subsections on the category page was limiting the listed articles to 3 rather than the default 6 which I've fixed now.

    0
  • Nicole Saunders
    Zendesk Community Manager

    Glad to hear you got things working, Chris! Thanks for letting us know.

    0
  • Daniel Cowlishaw

    Hi guys,

    Can someone please share how they resolved this? I'm trying to get all my articles in the category to show on the Category page, rather than clicking "See all articles", but having zero luck trying to do so.

    Kind Regards,

    Danny

    0
  • Brett Bowser
    Zendesk Community Manager

    Hey Danny,

    Looks like there's a community tip published that addresses your use-case: List all articles for each section(s) on the same category page

    This will require some custom code on your end but the above link should walk you through the appropriate steps.

    Hope this helps!

    0
  • Daniel Cowlishaw

    Hi Brett,

    Thanks for the response. I did find that tip but I want to remove the whole aspect of the articles being hidden in the first place.

    I don't know why its such a restriction on the system.

    Danny

    0
  • Brett Bowser
    Zendesk Community Manager

    Hey Danny,

    I'm afraid there isn't a way to change the default functionality at this time. The only way to display all articles on the category page is through the use of custom code.

    I'll be sure to mark this as product feedback so our Guide team is aware.

    Thanks for taking the time to share this with us!

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Tom Matthews  :)

     

    Please go through this given article to show all article in a section on category page:

    https://support.zendesk.com/hc/en-us/community/posts/4409515207578-List-all-articles-for-each-section-s-on-the-same-category-page

     

    Thanks

    Team Diziana

     

    0
  • Tom Matthews

    Hi Ifra Saqlain thanks for the steer. 

    Unfortunately this didn't work. 

    I still see the following:

    0

Por favor, entrar para comentar.

Powered by Zendesk