As you can see, there are two album nodes, one for images one for videos. What I try to do is to check video or image field. For example if in June there is not any video, then only display image album node.
After searching on umbraco, I could not find a solution so far...
A great way to do this with XSLT is to define separate templates for the video and image types, and then just process each type individually - something like this:
But based on following structure I placed a macro on "Flash" node.
- Flash
- June
- Picture
- Picture
- July
- Pictures
- Video
I gave it a try from this link XPATH Axes and their Shortcuts but with this code snippet, I can only reach till June node. How can I go deeper and check child nodes of June or July.
How to check a field
Hi everyone,
I have such structure...
- Flash
- June
- Picture
- Picture
- July
- Pictures
- Video
using an xslt file which turns infos into an xml file.
As you can see, there are two album nodes, one for images one for videos. What I try to do is to check video or image field. For example if in June there is not any video, then only display image album node.
After searching on umbraco, I could not find a solution so far...
I tried with xsl:if but did not work out.
Hi ds,
A great way to do this with XSLT is to define separate templates for the video and image types, and then just process each type individually - something like this:
/Chriztian
Hi Chriztian,
I made some changes on your code snippet,
But based on following structure I placed a macro on "Flash" node.
- Flash
- June
- Picture
- Picture
- July
- Pictures
- Video
I gave it a try from this link XPATH Axes and their Shortcuts but with this code snippet, I can only reach till June node. How can I go deeper and check child nodes of June or July.
Hi ds,
You can use the descendant:: axis (//) for this, e.g.:
- will select all nodes below $currentPage which has the 'image' property, regardless of level
If you want to group by month you could add another for-each inside, e.g.:
/Chriztian
Hi Chriztian,
Even though I tried with your code snippet, It does not give me the result.
Let me ask you in another way.
For such an outpout from xslt in the following, what should I do?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.