something very easy - if there are no child nodes display a message
i have a gallery of images. if there are no images in the gallery i need to display a message saying "there are no images at this time". How can i do this??
<xsl:choose> <xsl:when test="count(./node) > 0"> ...show the images... </xsl:when> <xsl:otherwise> <p>There are no images at this time</p> </xsl:otherwise> </xsl:choose>
If you need more details of how to implement this for your particular situation just let us know how you've set up your gallery.
well it looks like this (inlcuding your suggestion. But it is returning as an empty gallery even for the the galleries that have images (child nodes). Where am i going wrong????
something very easy - if there are no child nodes display a message
i have a gallery of images. if there are no images in the gallery i need to display a message saying "there are no images at this time". How can i do this??
The general idea would be something like this...
If you need more details of how to implement this for your particular situation just let us know how you've set up your gallery.
cheers,
doug.
well it looks like this (inlcuding your suggestion. But it is returning as an empty gallery even for the the galleries that have images (child nodes). Where am i going wrong????
<xsl:choose>
<xsl:when test="count(./node) > 0">
<div class="GalleryWrapperInline">
<xsl:for-each select="$currentPage/node">
<a class="example7 cboxElement" href="/gallery-lightbox?ID={data[@alias='LargePhoto']}&keywords={data[@alias='GalleryKeywords']}&Video={data[@alias='Video']}&Title={@nodeName}">
<img class="GalleryImgInline" src="{data[@alias='DisplayImage']}" alt="{@nodeName}" />
</a>
</xsl:for-each>
</div>
<div id="paradeGalleryBottom"> </div>
</xsl:when>
<xsl:otherwise>
<p>There are no images at this time</p>
</xsl:otherwise>
</xsl:choose>
Try changing
to
I think the '.' assumes you are inside a for loop, which it doesn't look like you are yet
Phil, try changing this line:
<xsl:when test="count(./node) > 0">
with this:
<xsl:when test="count($currentPage/node) > 0">
/Kim A
GOOD WORK FELLAS!!!
is working on a reply...