I can't find anywhere on Umbraco CMS very useful option which I have used before while using CMS like Drupal and Joomla. I kindly ask you to first look at the photo in attachment.
As you can see I would like to have option which will limit number of displayed articles in list. For example I would like to see 10 articles per page. Is this possible on Umbraco CMS because I cant find it anywhere under Macros?
Any help is appreciated and many thanks in advance for prompt reply!
Adi
Yes you can easily get this paging working either in xslt or razor.
Since you posted this threat under the xslt section here is how you can procee.
<xsl:variable name="about" select="umbraco.library:GetXmlNodeById('1067')"/><!-- Here is the NodeId from here you are pulling all the list of about -- >
<xsl:variable name="itemsToDisplay" select="10"/> <!-- Number of items to display per page --> <xsl:variable name="numberOfItems" select="count($about/*[@isDoc][not(umbracoNaviHide =1)])"/> <xsl:variable name="jump" select="$itemsToDisplay * $pageNumber" />
Separating 10 articles per page?
Hello,
I can't find anywhere on Umbraco CMS very useful option which I have used before while using CMS like Drupal and Joomla. I kindly ask you to first look at the photo in attachment.
As you can see I would like to have option which will limit number of displayed articles in list. For example I would like to see 10 articles per page. Is this possible on Umbraco CMS because I cant find it anywhere under Macros?
Any help is appreciated and many thanks in advance for prompt reply! Adi
Hi Adi,
It's not hard to do paging where you want. Is this macros maked with Razor ?
Hi Adi,
Yes you can easily get this paging working either in xslt or razor.
Since you posted this threat under the xslt section here is how you can procee.
Howevere if you want this in razor you can get the same result here.
Hope it helps
//fuji
Hi Adi,
If you want to do it in XSLT I think this are a good examples of how you could do it: You could give Lee Kelleher´ code a try.
https://gist.github.com/leekelleher/1122148
Or you could try use one of Chriztian Steinmeier´s XSLT helpers on GitHub. , He has made a Pagimation helper https://github.com/greystate/Greystate-XSLT-Helpers/tree/master/paginationhelper
Hope this can help you to do what you need in your case.
If you want to do it in Razor you can see an example here, It's using the "old" style Razor, but it should able to tweak it for v6 MVC style.
http://www.diplo.co.uk/blog/2011/6/21/creating-a-paged-list-in-umbraco-using-razor.aspx
If you´re using MVC you could use something like this I think:
Hope one of these examples I have linked to, or shown you can help you resolve your case with the page number.
/Dennis
Hello Fuji,
I have tried code you suggested but I receive erros which you can se bellow on picture:
![XSLT error][1]
and this is the code
Hello Fuji,
I have tried code you suggested but I receive erros which you can se bellow on picture:
and this is the code
Regarding this line of code
is working on a reply...