How would you go about displaying a “No content found” message on an assembled page, when a index in a slot has no content?
[Rx 5.7]
How would you go about displaying a “No content found” message on an assembled page, when a index in a slot has no content?
[Rx 5.7]
Roz,
You have to use the <xsl:if> tag, which means that you have to hand-write the slot code within “begin XSL” and “end XSL” comments.
I’ve done this, but it’s been a very long time, and I don’t have an example handy.
Dave
Hi Roz
You need to create a slot template in the RXROOT\rx_resources\stylesheets\assemblers\rx_Slots.xsl file.
<xsl:template match="rxslot[@template='SlotTemplateName']" priority="10">
<xsl:choose>
<xsl:when test="count(linkurl) < '1'">
<xsl:text>No Content Found</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="linkurl">
<xsl:if test="not(Value/@current = '')">
<xsl:copy-of select="document(Value/@current)/*/body/*"/>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Then you can add your template to the slot markup by adding the template attribute
<div slotname="YOURSLOTNME" template="SlotTemplateName" psxeditslot="yes"/>
Cheers
James
Thanks James. Sorted.