List all articles for each section(s) on the same category page

36 Comments

  • Keith Raucy
    Comment actions Permalink

    Getting an error of:

    Cannot read property 'split' of undefined

    0
  • Vladan Jovic
    Comment actions Permalink

    Very great tip and it works, thanks Diziana! I just have to adapt this row additionally:

    $(e.target).parent().find('ul.article-list').html(_arthtml);

    to some thing like this

     $(e.target).parent().html(_arthtml);
    0
  • Jessie Schutz
    Comment actions Permalink

    Thanks for sharing your adaptation, Vladan. :)

    0
  • Mary Haberle
    Comment actions Permalink

    This was very helpful--for future reference I wanted to share that, in my sandbox, the section title disappeared when the user clicked on "See all articles" and the full list popped up. But, once we implemented in our active help center, this problem disappeared and the section titles remained visible.

    0
  • Hiroko Kanazawa
    Comment actions Permalink

    These help me a lot! Also I want to know how to open the category page like the last image Diziana shows originally when I open the category page. "Originally" means without clicking any "see all articles".

    1
  • Nicholas Orr
    Comment actions Permalink

    Hi all,

    Does anyone know if there's a way to remove the "See all x articles" option completely, on all pages? So even in main page, where it's showing the individual sections, and some get cut off and some don't, I'd like to be able to always have those showing all articles.

    Any ideas?

    Cheers,

    Nick

    0
  • Vladan Jovic
    Comment actions Permalink

    Hi Nicholas, if you are on Copenhagen theme, this code should do that. Just add it at the bottom of your CSS file:

    .see-all-articles {
    display: none;
    }

    Let us know the result ;)

    0
  • Nicholas Orr
    Comment actions Permalink

    Vladan,

     

    Thanks, but that just hides the links, so you can't get to all the articles.  I want to to always expand to show all articles, regardless of how many are in a section.

     

    Thanks,

    Nick 

    0
  • Nicholas Orr
    Comment actions Permalink

    Vladan,

    Also, I'm on the older swiftest elk theme.

    Thanks,

    Nick

    0
  • Vladan Jovic
    Comment actions Permalink

    Ahh sorry, I didn’t understand what you meant.

    That can be achieved with a help of Zendesk API but it would require much more coding. If you have a front-end developer on your side, this link will be helpful for him:
    https://developer.zendesk.com/rest_api/docs/help_center/articles#list-articles

    Hope this helps.

     

     

     

    0
  • Randy Schreck
    Comment actions Permalink

    I changed the two lines like this:

    _arthtml = _arthtml + '<li class="'+(itm.promoted==true?'article-promoted':'')+'">

    to

    _arthtml = _arthtml + '<li class="article-list-item'+(itm.promoted==true?' article-promoted':'')+'">

    so that the default CSS formating would remain. Note the "space" before "article-promoted;" it's required for the code to be read correctly.

    We don't have any promoted articles yet, so I'm crossing my fingers nothing is broken, but it works very well so far. Thanks Diziana for the original code!

    0
  • Trapta
    Comment actions Permalink

    @Randy Schreck,

    Thanks for coming back and sharing your code. Glad that you liked it.

    Enjoy :)

    Team Diziana

    0
  • Yeny Rubiano
    Comment actions Permalink

    Hello ZenDesk Support Team,

    Is there a way to list only one specific Section on home page and a list of the articles within that section?

    0
  • Jessie Schutz
    Comment actions Permalink

    Hi Yeny!

    You should be able to hide or display just about anything with custom code. Can you give me more detail about what you're trying to accomplish here? We might have some community tips that will help you with you're working on.

    0
  • Yeny Rubiano
    Comment actions Permalink

    Hello Jessie, thanks for your prompt reply.

    I was able to pull up all sections on my home page using {{#each categories}} {{#each sections}} tokens and I used CSS to hide the ones I don't need by using their custom IDs.

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Hi Yeny -

    If I'm reading this correctly, it sounds like you got things all sorted. But do let us know if there are additional questions we can answer for you!

    0
  • Jeremy Tellier
    Comment actions Permalink

    I am looking to do this too, I would like it to show all the articles without needing to click a link. Is there a way to turn off the 6 article limit all together.

    0
  • Trapta
    Comment actions Permalink

    Hi Jeremy,

    You can increase the count of articles to 30. Please take a look at this post: https://support.zendesk.com/hc/en-us/community/posts/203458986-Show-less-than-6-articles-in-Guide?page=5#community_comment_360000010847

    You need to update the UI to update the look and feel of the list on the homepage.

    Let me know if this solves your issue.

    Team Diziana

    0
  • Jeremy Tellier
    Comment actions Permalink

    I did this little hack... I had to add a see-all-articles div because that was not in there by default but then just adding something like this loaded them and if it happens too soon I at least get a button that works like you show

    setTimeout(function() {
       $('.see-all-articles').click();
    }, 100);

    0
  • Dominic Eves
    Comment actions Permalink

    Hi,

    Is it possible to have all the articles showing on load without needing to press 'sell all'?

    https://outdoorandcountry.zendesk.com/hc/en-us/categories/360000141698--Our-Retail-Stores

    I want to view them all there without pressing see all. So onload they're all displayed without going to another page?

    Of if that's not possible is there a work around I could use?

    Thanks,

    0
  • Brett - Community Manager
    Comment actions Permalink

    Hey Dominic,

    I recommend taking a look at the following Community Tip posted by Diziani which goes over setting this up in your Help Center: List all articles for each section(s) on the same category page

    Hope this helps!

    -1
  • Dominic Eves
    Comment actions Permalink

    Hi,

    That links back to this post. I want to do it without having to press see all, so on page load, it just shows them there.

    Thanks,

    0
  • Brett - Community Manager
    Comment actions Permalink

    My mistake Dominic! Had too many windows open in my browser at the time of this post :(

    Hopefully someone from Diziana can reply back and offer up some guidance on how to accomplish what you're looking for.

    Cheers!

    0
  • Trapta
    Comment actions Permalink

    @Dominic,

    Please refer to this comment: https://support.zendesk.com/hc/en-us/community/posts/203458986-Show-less-than-6-articles-in-Guide?page=5#community_comment_360000010847

    Let me know if this solves your issue.

    Team Diziana

    0
  • Hedda Klintskog
    Comment actions Permalink

    Hi!

    I'm also trying to display all sections on the category page, but I'm using another solution. I'm also displaying the articles with the API but I have problem with internal articles. I can se the internal articles even  as an end user when the articles are displayed by the API request. Have anyone else had the sam problem?

     

    Best regards

    0
  • Vladan Jovic
    Comment actions Permalink

    hmm, they shouldn't be there for end-users. Are you using Preview mode? 

    If yes, can you try with a real end-user account? 

     

    0
  • Hedda Klintskog
    Comment actions Permalink

    Hi! I've tried as an end user in both preview mode and when the account is activated. When I display the articles by using the API I don't know how to determine whether they are internal or not. I've tried with "{{#if internal}}", but it was false for all the articles, even the internal ones.

     

    0
  • Hedda Klintskog
    Comment actions Permalink

    I think I solved it, I can use "user_segment_id" to check if the article can be viewed by everyone or not.

     

    Best regards

     

     

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Thanks for coming back and letting us know that you got that sorted out and for sharing the solution, Hedda!

    0

Please sign in to leave a comment.

Powered by Zendesk