Oddity
As I've been neck-deep in Velocity all day, this might be just another effect of script-blindness. I have two fields in my system-data-structure on this page, title and heading. For some reason, I can escape the ampersand character in the heading field, but it doesn't work in the title field. Am I really going blind here?
- ampersand.xml 1.17 KB
- script.txt 648 Bytes
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
1 Posted by Ryan Griffith on Sep 12, 2013 @ 03:49 PM
Hi Jim,
Were you able to get this working? I was able to successfully escape the two elements in my local Cascade Server 7.6 instance.
Please let me know if you have any questions.
Thanks!
2 Posted by steelej on Sep 18, 2013 @ 04:15 PM
Ryan,
Back at it. I'm on 7.6. This isn't working.
Here's what I've noted:
If I have the xml escape in the script for the header and use &, it doesn't render and in the XML view of the page the & has been changed to the ASCII:
&
If I enter
&
it escapes the character and displays&
As the same escape clause is used twice on the page and only works in the second instance.
I'm befuddled.
Jim
3 Posted by Ryan Griffith on Sep 19, 2013 @ 06:49 PM
Hi Jim,
This is correct, Cascade Server will encode the ampersand when generating the structured data to ensure the content is valid XML.
This would be expected because the ampersand will be encoded, leaving you with
&
, which is valid XML.I was able to get things working using the following setup:
Data Definition
Format
Values Entered on Page
Title:
Conferences & Registration
Heading:
test of &
Resulting HTML
4 Posted by steelej on Sep 19, 2013 @ 07:35 PM
Ryan,
As is usual, this was my error. I was in the middle of writing an explanation that the escape tool was working in both fields as evidenced in the XML output, but kicked an error when I tried to view it in HTML. Then I reread the error. It appears I set this page up to use the data-defined title value in the page title meta-tag which does not react well to an ampersand. That was what was crashing my HTML view. I just used the replaceAll() method for the page title format to replace the & with "and." Working now. I'll read my error messages more attentively from now on.
Thanks
Jim
steelej closed this discussion on Sep 19, 2013 @ 07:36 PM.