2 votes

Random Text DataType

Random Text DataType provides a list that can contain unlimited text blocks. These text blocks can be used with the supplied XSLT/Macro to retrieve a random block of text.

This is great for testimonials and quotes.

Give it try and let me know what needs to be improved. 

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

<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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"xmlns:randomtext.library="urn:randomtext.library" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets randomtext.library ">

<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>

<xsl:template match="/">

<xsl:value-of select="randomtext.library:GetRandomText($currentPage/data [@alias='quotes'], '|')" disable-output-escaping="yes"/>

</xsl:template>

 </xsl:stylesheet>

 

 

Screenshots

Archived files

Documentation

Source code

Package owner

Daniel Bardi

Daniel Bardi

Daniel has 2562 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Daniel Bardi
  • Created: 24/09/2009
  • Current version 1.0
  • License MIT
  • Downloads on Our: 1.2K

External resources