Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi! :)
I currently have an XSLT Image Gallery script
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Examine="urn:Examine" exclude-result-prefixes="msxml umbraco.library Examine "> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:variable name="mediaFolderId" select="number($currentPage/mediaFolderId)" /> <xsl:variable name="thumbWidth" select="number(256)" /> <xsl:variable name="thumbHeight" select="number(170)" /> <xsl:template match="/"> <!-- Displays all images from a folder in the Media Library --> <xsl:if test="number($mediaFolderId)"> <div id="Gallery"> <ul> <xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image"> <xsl:if test="umbracoFile !=''"> <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4"> <a href="{umbracoFile}" title="{@nodeName}" rel="gallery"> <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&width={$thumbWidth}&height={$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" /> </a> </li> </xsl:if> </xsl:for-each> </ul> </div> </xsl:if> </xsl:template> </xsl:stylesheet>
But i would like to get paging on, so after 10 or 20 images it makes a new page, but i can't figure it out :/
I don't know if it would be easier to make it an Partial View Macro?
I just got this from a friend, but he don't know how to make paging on it xD
Hi Anders,
For the paging, in XSLT, I think that you should take a look on the pagination helper from Chriztian Steinmeier https://github.com/greystate/Greystate-XSLT-Helpers/tree/master/paginationhelper.
Hope this helps,
/Dennis
It don't need to be XSLT it could be Partial View Macro or Razor .. :)
Okay for an Razor Partial view, or Partial view marco example try to see this topic and especially this http://our.umbraco.org/forum/developers/razor/41166-Razor-Paging-snippet?p=0#comment153493 comment from Lee Kelleher, I think it could be a good starting point or actually a solution for you.
Thanks!...
But it has to take items from an image folder, so fx after 20 images it makes a new "page"
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Image Gallery Problem
Hi! :)
I currently have an XSLT Image Gallery script
But i would like to get paging on, so after 10 or 20 images it makes a new page, but i can't figure it out :/
I don't know if it would be easier to make it an Partial View Macro?
I just got this from a friend, but he don't know how to make paging on it xD
Hi Anders,
For the paging, in XSLT, I think that you should take a look on the pagination helper from Chriztian Steinmeier https://github.com/greystate/Greystate-XSLT-Helpers/tree/master/paginationhelper.
Hope this helps,
/Dennis
It don't need to be XSLT it could be Partial View Macro or Razor .. :)
Hi Anders,
Okay for an Razor Partial view, or Partial view marco example try to see this topic and especially this http://our.umbraco.org/forum/developers/razor/41166-Razor-Paging-snippet?p=0#comment153493 comment from Lee Kelleher, I think it could be a good starting point or actually a solution for you.
Hope this helps,
/Dennis
Thanks!...
But it has to take items from an image folder, so fx after 20 images it makes a new "page"
is working on a reply...