I have a page that represents a list of items (quotes) on the page is the above data type that I set up and added two properties to it 'quote' and 'by'.
As the quotes are shared by all my pages this is why they are in a page seperate from my site (common content folder).
I have the following XSLT for looping through the quotes on my page.
<xsl:value-of select="$quotesPage" />
The above line returns all the quotes but the loop doesn't loop through each node as it should (according to the developer see his xslt). Can anyone help please?
<xsl:param name="currentPage"/>
<xsl:variable name="minLevel" select="1"/> <xsl:variable name="quotesPage" select="umbraco.library:GetXmlNodeById('1092')"/> <!-- Input the repeatable custom contents property alias here --> <xsl:variable name="propertyAlias" select="string('quotes')"/> <xsl:template match="/"> <xsl:value-of select="$quotesPage" />
Just to make sure - your not using 4.52 with new schema are you? In that case you'll need to change that xslt. I think this would do it (but I'm not experienced with the new syntax so I might very well be wrong ...)
$quotesPage/quotes/items/item
Whats that "Live Editing support for related links" btw?
Regards,
Jonas
Ps. I'm using repeatable custom content for the same purpose (with legacy schema though).
<!-- Input the repeatable custom contents property alias here --> <xsl:variable name="propertyAlias" select="string('quotes')"/> <xsl:template match="/"> <!-- The fun starts here --> <xsl:if test="$quotesPage/quotes/items/item">
</xsl:if> </xsl:for-each> <!-- Live Editing support for related links. --> <xsl:value-of select="umbraco.library:Item($quotesPage/@id,$propertyAlias,'')" /> </xsl:if>
</xsl:template>
<msxsl:script language="c#" implements-prefix="randomTools"> <msxsl:assembly href="../bin/umbraco.dll"/> <![CDATA[ /// <summary> /// Gets a random integer that falls between the specified limits /// </summary> /// <param name="lowerLimit">An integer that defines the lower-boundary of the range</param> /// <param name="upperLimit">An integer that defines the upper-boundary of the range</param> /// <returns>A random integer within the specified range</returns> public static int GetRandom(int lowerLimit,int upperLimit) { Random r = umbraco.library.GetRandom(); int returnedNumber = 0; lock (r) { returnedNumber = r.Next(lowerLimit, upperLimit); } return returnedNumber; } ]]> </msxsl:script>
Repeatable custom contents package question
I have a page that represents a list of items (quotes) on the page is the above data type that I set up and added two properties to it 'quote' and 'by'.
As the quotes are shared by all my pages this is why they are in a page seperate from my site (common content folder).
I have the following XSLT for looping through the quotes on my page.
The above line returns all the quotes but the loop doesn't loop through each node as it should (according to the developer see his xslt). Can anyone help please?
Hi!
Just to make sure - your not using 4.52 with new schema are you? In that case you'll need to change that xslt. I think this would do it (but I'm not experienced with the new syntax so I might very well be wrong ...)
$quotesPage/quotes/items/item
Whats that "Live Editing support for related links" btw?
Regards,
Jonas
Ps. I'm using repeatable custom content for the same purpose (with legacy schema though).
Thanks Jonas, is there any documentation on the new schema? I didn't even know one existed.
Here is what I ended up with to get the code working. What is happening is that I have a list of quotes and show one at random:
is working on a reply...