Trying to get a format to work

Fernando's Avatar


16 Aug, 2016 08:44 PM

I am trying to turn on and off this image that shows up on my homepage slideshow. So I created a if statement when the user hits yes ($umsldailyYesN) you can add and image to it

but for some reason I cant get it to work right. It assumes it is turned on all the time. Could you take a look at it and see what you think?


  1. 1 Posted by Bradley Wagner on 19 Aug, 2016 01:45 PM

    Bradley Wagner's Avatar

    Hi Fernando,

    I noticed in your format that you're attempting to check this here:

    #set($umsldailyYesNo = $_XPathTool.selectSingleNode($contentRoot, "//system-data-structure/slide/umsldaily1").value)            
    #if($umsldailyYesNo == "Yes")

    I think what might be happening is that you're effectively checking the same selectSingleNode in every iteration of your loop. You need to scope your XPath there to either use your current slide as the context or to specifically access that umsldaily1 node by name as you're doing above for this other field:

    #set($link = $_EscapeTool.xml($slide.getChild("symlink").getChild("content").getChild("system-symlink").value))

    Currently, you're checking the same value for the first slide over and over again.

    Let me know if that makes sense.


Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac


26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM