Hi guys, am a seasoned .net developer creating my first umbraco 4.0.4.1 site and have a problem, the below macro which has been modified for paging and order by functionality renders fine when i use it to show my list of members and my list of member servces but does not render fine when it comes to my news stories, when it renders fine i get :-
<!-- These global variables passed in from Macro -->
<!-- The attribute in the node to sort by (createDate, updateDate, nodeName etc.) OR a 'friendly title' from page property --> <xsl:variable name="sortBy" select="/macro/sortBy"/> <!-- Sort direction - either 'ascending' or 'descending' --> <xsl:variable name="sortDirection" select="/macro/sortDirection"/> <!-- Optional document alias to only return documents of that type --> <xsl:variable name="nodeTypeAlias" select="/macro/nodeTypeAlias"/> <!-- Date format string - standard .NET formatting eg. 'd' or 'D' --> <xsl:variable name="dateFormatString" select="/macro/dateFormatString"/> <!-- Set to '1' to show date --> <xsl:variable name="showDate" select="/macro/showDate"/> <!-- Set to '1' to show pagination numbers --> <xsl:variable name="showPageNumbers" select="1"/> <!-- Set to '1' to output debug paramaters --> <xsl:variable name="showDebug" select="/macro/showDebug"/>
<!-- Checks if 'sortBy' variable has a 'friendly title' and assigns it to $orderBy variable (otherwise uses value of $sortBy) --> <xsl:variable name="orderBy"> <xsl:choose> <xsl:when test="$sortBy = 'Created Date'">createDate</xsl:when> <xsl:when test="$sortBy = 'Edited Date'">updateDate</xsl:when> <xsl:when test="$sortBy = 'Page Title'">nodeName</xsl:when> <xsl:when test="$sortBy = 'Menu Order'"></xsl:when> <xsl:otherwise> <xsl:value-of select="$sortBy"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
<!-- This holds the value of the sortBy column and is used to evaluate if it's a date --> <xsl:variable name="dateString" select="$orderBy"/> <xsl:variable name="pageQS" select="umbraco.library:RequestQueryString('page')" />
<!-- Variables used for pagination --> <xsl:variable name="pageNumber"> <xsl:choose> <xsl:when test="$pageQS <= 0 or string($pageQS) = '' or string($pageQS) = 'NaN'">1</xsl:when> <xsl:otherwise> <xsl:value-of select="umbraco.library:RequestQueryString('page')"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
<!-- Number of records per page (from Macro but defaults to 10) --> <xsl:variable name="recordsPerPage"> <xsl:choose> <xsl:when test="/macro/recordsPerPage"> <xsl:value-of select="/macro/recordsPerPage"/> </xsl:when> <xsl:otherwise>35</xsl:otherwise> </xsl:choose> </xsl:variable>
<!-- End Global Variable Declaration -->
<!-- This template performs matches and sort --> <xsl:template match="/">
<!-- Count child nodes to get number of records --> <xsl:variable name="numberOfRecords" select="count($currentPage/node)"/>
Can't see myself what the problem is but what I'd do is to try and narrow it down and see where the logic is breaking down. Throw in a few debug statements.
Is it getting inside the Node template or is the apply-templates failing? is the IF statement within the Node template failing?
just some more info though, is $currentpage the News page and the news items, the sub items, like this:
News
-News Item
-News Item
Does this differ from how the member and member services layout or is it the same? Do you need $currentPage/node::descendant-or-self in the apply-templates?
xslt list sub pages problem
Hi guys, am a seasoned .net developer creating my first umbraco 4.0.4.1 site and have a problem, the below macro which has been modified for paging and order by functionality renders fine when i use it to show my list of members and my list of member servces but does not render fine when it comes to my news stories, when it renders fine i get :-
which is great, but i have a news node with news item sub-nodes. The same xslt renders only :-
Would greatly appreciate some help my xslt file is :-
Thanks in advance :)
Can't see myself what the problem is but what I'd do is to try and narrow it down and see where the logic is breaking down. Throw in a few debug statements.
Is it getting inside the Node template or is the apply-templates failing? is the IF statement within the Node template failing?
just some more info though, is $currentpage the News page and the news items, the sub items, like this:
News
-News Item
-News Item
Does this differ from how the member and member services layout or is it the same? Do you need $currentPage/node::descendant-or-self in the apply-templates?
Sorry couldn't be of more help.
is working on a reply...