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
I am trying to sort the News Feed List under a News Area and am having difficulties. I changed the umbNewsFeedList.xslt file as follows:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:sort select="@sortOrder" order="ascending" /> <h3 class="headline"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a>
by changing @updateDate to @sortOrder.
It works for some of the News items, but not all. Does the @isDoc come into play? I have created a couple new documentTypes and Templates that are used under the News Area.
Any help is appreciated.
Thank you,
Tim
I think the problem is caused by data, not your code. Because of "It works for some of the News items, but not all".
Have a look at the file: ~/App_Data/umbraco.config, if the sorrOrder value is correct?
Might be you can republish the whole news items.
Hi Tim,
Do you have any Date Time attached to your newsItem Page? In your xslt you could try to change this line from
<xsl:sort select="@sortOrder" order="ascending" />
to
<xsl:sort select="current()/newsDate" order="ascending"/>
Here the newsDate is another field you could add to your Document Type with type DatePicker.
Hi!
I think this is becuse that the @SortOrder-parameter is treated as a string. You have to convert it into a number to get the correct result.
<xsl:sortselect="@sortOrder"order="ascending"data-type="number"/>
@Markus - You rock!! That was the issue. Thank you very much.
Thanks to Owen and Fuji for their responses. It's very cool to have such a great community to learn from.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Sorting NewsListItems
I am trying to sort the News Feed List under a News Area and am having difficulties. I changed the umbNewsFeedList.xslt file as follows:
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:sort select="@sortOrder" order="ascending" />
<h3 class="headline"> <a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
by changing @updateDate to @sortOrder.
It works for some of the News items, but not all. Does the @isDoc come into play? I have created a couple new documentTypes and Templates that are used under the News Area.
Any help is appreciated.
Thank you,
Tim
I think the problem is caused by data, not your code. Because of "It works for some of the News items, but not all".
Have a look at the file: ~/App_Data/umbraco.config, if the sorrOrder value is correct?
Might be you can republish the whole news items.
Hi Tim,
Do you have any Date Time attached to your newsItem Page? In your xslt you could try to change this line from
to
Here the newsDate is another field you could add to your Document Type with type DatePicker.
Hi!
I think this is becuse that the @SortOrder-parameter is treated as a string. You have to convert it into a number to get the correct result.
<xsl:sortselect="@sortOrder"order="ascending"data-type="number"/>
@Markus - You rock!! That was the issue. Thank you very much.
Thanks to Owen and Fuji for their responses. It's very cool to have such a great community to learn from.
Tim
is working on a reply...