I need to prevent Cascade from adding a slash to my code.
I have this line of code in one of my templates:
<h2><a href="/{{url}}">{{title}}</a></h2>
I need to remove that forward slash in front of {{url}}. I've removed it from the published code and it's fixing the problem I'm having. But whenever I try to take it out of the template, it adds it right back in. How do I keep it from doing this?
Comments are currently closed for this discussion. You can start a new one.
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 05 Jun, 2015 04:26 PM
Hi,
To confirm, is this code from a templating library? When you have a moment, can you describe your setup a bit so I can try to reproduce this behavior locally? For instance, is this a Template asset, an XML/XHTML Block, or a template file you are maintaining within Cascade.
Also, what version of Cascade are you experiencing this behavior in?
Please let me know if you have any questions.
Thanks!
2 Posted by webadmin on 05 Jun, 2015 04:34 PM
I assume by template asset you mean a file that is designated as a template in Cascade, right? If so, yes, it's a template asset.
The version is: 7.12.5 - ac31f
3 Posted by Ryan Griffith on 05 Jun, 2015 06:19 PM
Thank you for following up to confirm.
When you have a moment, please attach or paste the contents of the Template so I can do some local testing.
Please let me know if you have any questions.
Thanks!
4 Posted by webadmin on 08 Jun, 2015 01:49 PM
The template is attached. The line in question is line 162.
5 Posted by Ryan Griffith on 08 Jun, 2015 02:13 PM
Thank you for providing your Template code to test with.
I was able to reproduce the same behavior and I believe the issue is coming from either the XML validation and cleanup routine that Templates undergo upon submission to ensure valid XML or link rewriting.
There are a couple of possible solutions that should do the trick:
<script>
tags with CDATA protect code sections. For example:<script>
tags into an XML Block(s), which don't undergo the same cleanup/rewriting routines as TemplatesPlease let me know if you have any questions.
Thanks!
6 Posted by webadmin on 08 Jun, 2015 02:20 PM
I used the #protect tags, and that did it. Thanks!
7 Posted by Ryan Griffith on 08 Jun, 2015 02:25 PM
Thank you for following up to confirm the protect code sections did the trick. I figured that solution would be the best route since it required no changes to your existing setup.
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 08 Jun, 2015 02:25 PM.