I have a news XSLT where there is about 20items being displayed monthly and to make this more user friendly i added a pagintor but its not showing up. To this has anything to do with the fact that am using the macros in the eidtor?
You can't just visualise this xslt since you are pulling a variable from the macro - what happens when you change the source variable from a macro value to an existing page id?
If its not this please advise what happens - does nothing appear at all or just no pagination?
Yes am using my macro in editor to pull the data since am using the same template all over the website. So you recommend not to use macro in editor?... can I you why this is not recommended?
You don't want your editors to have to decide what macro's are in your pages. They should just create a page of some type and get all the other stuff for free. Besides, it's very error prone to do this.
Inserting macro's in a rich text editor should always be a last resort when you really HAVE to have something dynamic in the middle of some content somewhere, maybe. Even then, I would try and split it up into two editors and a macro picker in the middle somewhere.
You are right....good point but you wouldnt even recommend accessing media content using macros in editor?.....
Lets say the user can actually creates and crop its images in the media section and then from the content when creating a new album (node) access the media folder using a macro in the editor.
I'm with Sebastiaan on this, I avoid allowing Macros in the RTE unless 100% necessary, in fact I turn off as many of the RTE toolbar items as I can get away with.
Inserting media can be ok, but if the layout is consistent and you know where the image is going then imho it's better to have the user select this image via a DocType property and then let your xslt/razor/template display the image.
Yes i do agree with both of you, it is not a good thing to give full access to client then you find yourself cleaning all the mess.
For the media part am only using it this way so as to allow the client to acess any of hes created media item since this will end up as a slideshow when he will be browsing. But what if he has like 100 images?..
Yes am picking images using mediacurrent, you might be asking yourself why?
Well its only because the client wants to be able to create a new album (node)under the Photo Gallery section and from there br able to acess the media section.
Am back working on the project and did implement the macro in template instead of RTE. Everything is working except for the part where i need to go to the next page. The content of my page is not changing at all, i can see from the url that it is working but not for the content.
XSLT Paging in editor not working
Hi guys,
I have a news XSLT where there is about 20items being displayed monthly and to make this more user friendly i added a pagintor but its not showing up. To this has anything to do with the fact that am using the macros in the eidtor?
here is the piece of code am using
<xsl:variable name="source" select="/macro/source"/>
<xsl:variable name="itemsToDisplay" select="10"/>
<xsl:variable name="numberOfItems" select="count($currentPage/* [@isDoc and string(umbracoNaviHide) != '1'])"/>
<!-- Paging -->
<xsl:variable name="pageNumber">
<xsl:choose>
<xsl:when test="umbraco.library:RequestQueryString('page') = ''">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="/">
<!-- The fun starts here -->
<ul class="eventList">
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:sort select="current()/eventDate" order="descending"/>
<xsl:if test="position () <= $itemsToDisplay">
<li class="eventLink">
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="eventTitle"/> </a>
</li>
<li style="padding-left:15px; font-style:italic;"> <!--<em style="font-size:10px;"><xsl:value-of select="umbraco.library:FormatDateTime(./eventDate, 'd MMMM, yyyy')" disable-output-escaping="yes"/> </em> <br/>-->
<xsl:value-of select="umbraco.library:TruncateString(eventDescription,250,'...')" disable-output-escaping="yes"/>
</li>
</xsl:if>
</xsl:for-each>
</ul>
<xsl:if test="$pageNumber > 1">
<a href="?page={$pageNumber -1}#events">previous </a>
</xsl:if>
<xsl:call-template name="for.loop">
<xsl:with-param name="i"> 1 </xsl:with-param>
<xsl:with-param name="count" select="ceiling($numberOfItems div $itemsToDisplay)"></xsl:with-param>
</xsl:call-template>
<xsl:if test="(($pageNumber) * $itemsToDisplay) < ($numberOfItems)">
<a href="?page={$pageNumber+1}#events"> next</a>
</xsl:if>
</xsl:template>
<xsl:template name="for.loop">
<xsl:param name="i"/>
<xsl:param name="count"/>
<xsl:if test="$i <=$count">
<xsl:if test="$pageNumber!= $i">
<a href="?page={$i}#events"><xsl:value-of select="$i" /> </a>
</xsl:if>
<xsl:if test="$pageNumber = $i">
<xsl:value-of select="$i"/>
</xsl:if>
<xsl:call-template name="for.loop">
<xsl:with-param name="i" select="$i + 1" />
<xsl:with-param name="count" select="$count">
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
//fuji
What do you mean you are using it in the editor?
You can't just visualise this xslt since you are pulling a variable from the macro - what happens when you change the source variable from a macro value to an existing page id?
If its not this please advise what happens - does nothing appear at all or just no pagination?
You shouldn't put a paging macro in the rich text editor, put it in your template instead.
Hi Sebastiaan,
Yes am using my macro in editor to pull the data since am using the same template all over the website. So you recommend not to use macro in editor?... can I you why this is not recommended?
//fuji
You don't want your editors to have to decide what macro's are in your pages. They should just create a page of some type and get all the other stuff for free. Besides, it's very error prone to do this.
Inserting macro's in a rich text editor should always be a last resort when you really HAVE to have something dynamic in the middle of some content somewhere, maybe. Even then, I would try and split it up into two editors and a macro picker in the middle somewhere.
You are right....good point but you wouldnt even recommend accessing media content using macros in editor?.....
Lets say the user can actually creates and crop its images in the media section and then from the content when creating a new album (node) access the media folder using a macro in the editor.
//fuji
Hey,
I'm with Sebastiaan on this, I avoid allowing Macros in the RTE unless 100% necessary, in fact I turn off as many of the RTE toolbar items as I can get away with.
Inserting media can be ok, but if the layout is consistent and you know where the image is going then imho it's better to have the user select this image via a DocType property and then let your xslt/razor/template display the image.
Rich
Hi Rich,
Yes i do agree with both of you, it is not a good thing to give full access to client then you find yourself cleaning all the mess.
For the media part am only using it this way so as to allow the client to acess any of hes created media item since this will end up as a slideshow when he will be browsing. But what if he has like 100 images?..
//fuji
I'm not sure what you mean, are you picking images for a slideslow in the RTE?
Yes am picking images using mediacurrent, you might be asking yourself why?
Well its only because the client wants to be able to create a new album (node)under the Photo Gallery section and from there br able to acess the media section.
I'm still not 100% but I'm going to guess that you need to your client to pick 20 images from the media section and display them in a slideshow?
If this is the case then you can just use the http://ucomponents.codeplex.com/wikipage?title=MultiNodeTreePicker&referringTitle=Documentation and set it to media, then your client can pick 20 images and have a preview too.
I think this thread has gone a little off topic, maybe my fault!
Rich
No worries, i wanted to know if it was possible to make a paging work in RTE.
Its always good to get the best advise.
//fuji
Hey Rich,
Am back working on the project and did implement the macro in template instead of RTE. Everything is working except for the part where i need to go to the next page. The content of my page is not changing at all, i can see from the url that it is working but not for the content.
Is there something am missing?
//fuji
I can't see where you are changing your output based on your paging results. I would have thought that this:
<xsl:if test="position () <= $itemsToDisplay">
should look something like this:
Hi Stuart,
Thanks for the help got it working.
//fuji
is working on a reply...