link rewriting
How do I get the link field to rewrite itself in Velocity?
Instead of:
<meta name="thumbnail"
content="http://www.union.edu/admissions/profiles/img/feature-tile/live-learn-minerva.png"
/>
It's rendering:
<meta name="thumbnail"
content="site://reboot/admissions/profiles/img/feature-tile/live-learn-minerva.png"
/>
Here's my Velocity code and attached is my page XML.
#set ($thumbnail = $_XPathTool.selectSingleNode($contentRoot, '//system-page/system-data-structure/header/thumbnail/link').value'))
#if ($thumbnail)
<meta name="thumbnail" content="${thumbnail}" />
#end
I'm running Cascade 7.12.4.
- page.xml 8.98 KB
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 Wing Ming Chan on 23 Apr, 2015 04:55 PM
Erik,
Try something like this:
Wing
2 Posted by Ryan Griffith on 23 Apr, 2015 06:31 PM
Hi Erik,
To echo Wing's suggestion, here are a few alternatives, the key is to use the
[system-asset]
pseudo tag:Please let me know if you have any questions.
Thanks!
3 Posted by Wing Ming Chan on 24 Apr, 2015 12:08 PM
Ryan,
I tried to document this example in my site. But I had a very hard time dealing with the string literal "[system-asset]". I even turned all punctuations to unicode characters. It still did not work. Right now I just added a space between "[" and "s". How do I escape this string so that it can be displayed on a page (the string is in fact in the WYSIWYG)?
By the way, I am very happy that the Edit button is back.
Wing
4 Posted by Ryan Griffith on 24 Apr, 2015 01:28 PM
Hi Wing,
Although not ideal, placing a space within the tag is definitely the best way to go. If you wish to avoid the space from appearing on the page (and when copying), we use the following on our KB:
The comment and space will cause the pseudo tag to be skipped, but because we the space is commented out, it will not appear to the user.
Please let me know if you have any questions.
Thanks!
5 Posted by Wing Ming Chan on 24 Apr, 2015 01:48 PM
Ryan,
By using a comment containing a space? What a funny way! But thank you for the info.
Wing
6 Posted by Ryan Griffith on 24 Apr, 2015 02:16 PM
I know, right. So unconventional, but it works!
I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.
Have a great day!
7 Posted by espanae on 24 Apr, 2015 04:03 PM
Thanks for the tips, guys. I reviewed the knowledge base and see that the
[system-asset]
tags are needed because Google's<meta content=".."/>
tag isn't one of the recognized attributes tracked automatically.But I noticed Velocity is omitted from the list of assets that support "System-asset" and wanted to point that out.

8 Posted by Ryan Griffith on 24 Apr, 2015 04:10 PM
Thank you for notifying us of the incorrect information, Erik. I went ahead and updated the content to simply Formats so it includes both types.
I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.
Have a great day!
Ryan Griffith closed this discussion on 24 Apr, 2015 04:10 PM.