Quotes

sbarre5's Avatar

sbarre5

11 May, 2015 03:38 PM

I'm running a velocity script:

#set ($pages = $_XPathTool.selectNodes($contentRoot, "//system-folder/system-page"))
#foreach ($page in $pages)
   #set ($block_path = $_XPathTool.selectSingleNode($page, ".//row-block/path").value)
   #set ($block = $_.locateBlock($block_path, $currentPageSiteName))
   #set ($article_title = $block.getStructuredDataNode("news-article/article-title").textValue)
#end
<a href="$path">$_EscapeTool.xml($article_title)</a>

It's getting the correct value except I have about 15 of 50 article titles that are showing up with quotation marks before the actual title.

Any idea what I could be doing wrong?

  1. 1 Posted by Ryan Griffith on 11 May, 2015 06:45 PM

    Ryan Griffith's Avatar

    Hi,

    I am definitely not seeing any extra quotes in here, so that issue is out of the picture. One issue I am seeing in the snippet you provided is that you are outputting the link outside of the loop. Oddly, this should result in only one link being generated.

    Aside from that, perhaps try adjusting the line with the link with the following to see if maybe there is some issue with the mixed HTML and Velocity code:

    <a href="${path}">${_EscapeTool.xml($article_title)}</a>
    

    Please let me know if you have any questions.

    Thanks!

  2. Support Staff 2 Posted by Tim on 17 Jun, 2015 01:47 PM

    Tim's Avatar

    Hi there,

    Just wanted to make sure you saw Ryan's comment above. Let us know if you need more help.

    Thanks

  3. Tim closed this discussion on 30 Jun, 2015 06:43 PM.

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

Keyboard shortcuts

Generic

? 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