Hi i have an issue here where i need to check if nodes under a folder with id 1315 are published. What am trying to do is if the nodes are published i will get the values and if not a message will be displayed instead.
So far he nodes are displayed when i publish them but when unpublish i cant get the message "No Page found" to display. I also have a max number 3 items being published.
here is how i proceeded.
<xsl:for-each select="umbraco.library:GetXmlNodeById(1315)/* [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:sort select="current()/newsPublished" order="descending"/> <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(1315)" /> <xsl:choose> <xsl:when test="$node/@nodeName !='' and position() <= $maxNews"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="shortDescription" disable-output-escaping="yes"/> </a> </xsl:when> <xsl:otherwise> No Page Found </xsl:otherwise> </xsl:choose> </xsl:for-each>
I really don't think I understand - are you trying to add the image in case there's only e.g. 2 published nodes, so you can always have $maxNews items showing?
Checking published node
Hi i have an issue here where i need to check if nodes under a folder with id 1315 are published. What am trying to do is if the nodes are published i will get the values and if not a message will be displayed instead.
So far he nodes are displayed when i publish them but when unpublish i cant get the message "No Page found" to display. I also have a max number 3 items being published.
here is how i proceeded.
Hi Fuji,
Unpublished nodes does not exist in the XML, so you can't really test their (non-)existence.
If you need to do something like that, you'll have to "unpublish" by means of a property instead (but that defeats the purpose, I think).
/Chriztian
Hi Chriztian,
Thanks for replying. I somehow got it working by using some css hacks. So that when there is no value being displayed and image instead takes over.
But what if i want to add the image in my xslt instead...
Here again i cant get <xsl:otherwise> to take over when the nodes are unpublished. //fujiHi Fuji,
I really don't think I understand - are you trying to add the image in case there's only e.g. 2 published nodes, so you can always have $maxNews items showing?
/Chriztian
Nope am trying to show the image when no nodes are published.
Hi Fuji,
OK - well, then try this:
/Chriztian
Yes, this works perfectly Chriztian.
Regards
//fuji
is working on a reply...