Microdata itemscope attribute
Hello,
We are tagging up some of our markup with microdata and Cascade does not like the itemscope attribute because it is an attribute without an "=". What is the proper way to pass it through without the error, or without Cascade substituting itemscope="" ? We are referencing this via Format with Velocity.
Thank You.
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 07 Oct, 2015 06:30 PM
Hi,
Curious, but did you try surrounding the code containing the attribute with a
#protect
tag? This should tell Cascade to skip over that content during XML validation.Please let me know if you have any questions.
Thanks!
2 Posted by t1merritt on 08 Oct, 2015 04:51 PM
Hi Ryan,
Yeah, tried it and Cascade is barking at it. Maybe I’m not quite implementing the #protect tag quite right. Tried it both ways, <!—#protect #protect—> and <![CDATA[#protect #protect]]>
Here’s the line of code we are trying to accomplish with the attribute:
<li class="$eventTypeClass” itemscope itemtype="http://data-vocabulary.org/Event”>
Thanks much for any other suggestions.
3 Posted by Ryan Griffith on 08 Oct, 2015 07:15 PM
Hi,
Where are you placing the code section tags? What error are you seeing?
Thanks!
4 Posted by t1merritt on 08 Oct, 2015 10:32 PM
I’m just wrapping the itemscope, like so:
<li class="$eventTypeClass" <!—#protect itemscope #protect—> itemtype="http://data-vocabulary.org/Event">
And, this is the error:
An error occurred while rendering asset preview: Error on line 26: Element type "li" must be followed by either attribute specifications, ">" or "/>".
This is the original error without the protect code:
An error occurred while rendering asset preview: Error on line 26: Attribute name "itemscope" associated with an element type "li" must be followed by the ' = ' character.
Thank You.
5 Posted by Ryan Griffith on 09 Oct, 2015 05:12 PM
Thank you for following up.
Instead of wrapping the attribute, try to wrap the entire
<li>
and let me know how it works out:If you need to see the list item, you could try the following. In some situations; however, the
-->
portion of the first#protect
gets dumped to the page, but worth a shot.Please let me know if you have any questions.
Thanks!
6 Posted by t1merritt on 12 Oct, 2015 04:03 PM
Okay,
So here’s the solution that worked. It’s a protect on the opening and the closing tag:
Thanks much for your time, Ryan.
Support Staff 7 Posted by Tim on 12 Oct, 2015 04:06 PM
Thanks for the update and for posting your working solution! I'm glad Ryan was able to help you out. Have a good one!
Tim closed this discussion on 12 Oct, 2015 04:06 PM.