Hi,
I am using the out of the box "Most Recent Articles" and I'm wondering if how to use pagination for this one once it reached more than 10 results.
Thank you,
rome
*This post is locked for comments
Hi,
I am using the out of the box "Most Recent Articles" and I'm wondering if how to use pagination for this one once it reached more than 10 results.
Thank you,
rome
*This post is locked for comments
Hi Rome,
It looks like you are happy what OOB Portal propose you but you just want longer list with Paging.
You can easily achieve it with basic Javascript:
Go to Portals->WebTemplates->Knowledge Management - Most Recent Articles and edit it.
I used first-found simple pagination on GitHub here
You should definitely modify this customization, but you can start with something like (highlighted changed places from OOB):
{% assign count = 30 %} {% assign languagecode = website.selected_language.code %} <script src="cdn.rawgit.com/.../jquery.easyPaginate.js" ></script> <style> #easyPaginate a {display:block;margin-bottom:5px;} .easyPaginateNav a {padding:5px;} .easyPaginateNav a.current {font-weight:bold;text-decoration:underline;} </style> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title">{% editable snippets 'KnowledgeMgmt/MostRecentArticles' type: 'text', default: resx['KnowledgeMgmt_Most_Recent_Articles'], escape: true, tag: 'span' %}</div> </div> {% assign recent_articles = knowledge.articles | recent: count,languagecode %} {% if recent_articles %} <div class="list-group" id="easyPaginate"> {% for article in recent_articles %} <a class="list-group-item" href="{{ article.url | escape }}"><div class="pull-right text-muted small" style="margin-left: 5px;">{{ article.modifiedon | date: 'MMM d, yyyy' | escape }}</div>{{ article.title | escape }}</a> {% endfor %} </div> {% endif %} <script type="text/javascript"> $(function() { $('#easyPaginate').easyPaginate({ paginateElement: 'a', elementsPerPage: 5 }); }); </script> </div>
Which gives you a list of 30 last articles on 6 or fewer pages:
I want to use the Entity List but it won't let me filter the results by content access level. I'm "entity listing" Knowledge Articles.
Hi Rome,
Entity List come with pagination and if you want to customize entity list then you should add pagination manually. follow below link for an example. Page Size you can set in Entity list
docs.microsoft.com/.../render-entity-list-current-page
Thanks
Justin Jose
You can use an Entity List to display the results, and set the page size. This will automatically have paging for you.
André Arnaud de Cal...
292,489
Super User 2025 Season 1
Martin Dráb
231,305
Most Valuable Professional
nmaenpaa
101,156