tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/18404-i-need-to-prevent-cascade-from-adding-a-slash-to-my-codeCascade CMS: Discussion 2015-06-08T14:25:49Ztag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-05T15:42:40Z2015-06-05T15:42:40ZI need to prevent Cascade from adding a slash to my code.<div><p>I have this line of code in one of my templates:</p>
<pre>
<code><h2><a href="/{{url}}">{{title}}</a></h2></code>
</pre>
<p>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?</p></div>webadmintag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-05T16:26:48Z2015-06-05T16:26:48ZI need to prevent Cascade from adding a slash to my code.<div><p>Hi,</p>
<p>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.</p>
<p>Also, what version of Cascade are you experiencing this behavior
in?</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-05T16:34:46Z2015-06-05T16:34:46ZI need to prevent Cascade from adding a slash to my code.<div><p>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.</p>
<p>The version is: 7.12.5 - ac31f</p></div>webadmintag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-05T18:19:35Z2015-06-05T18:19:35ZI need to prevent Cascade from adding a slash to my code.<div><p>Thank you for following up to confirm.</p>
<p>When you have a moment, please attach or paste the contents of
the Template so I can do some local testing.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-08T13:49:02Z2015-06-08T13:49:02ZI need to prevent Cascade from adding a slash to my code.<div><p>The template is attached. The line in question is line 162.</p></div>webadmintag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-08T14:13:35Z2015-06-08T14:13:35ZI need to prevent Cascade from adding a slash to my code.<div><p>Thank you for providing your Template code to test with.</p>
<p>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.</p>
<p>There are a couple of possible solutions that should do the
trick:</p>
<ul>
<li>Wrap the contents of your <code><script></code> tags with
CDATA protect code sections. For example:
<pre>
<code><script id="event-template" type="text/x-handlebars-template"><![CDATA[#protect
<div id="calendarSpacer" ></div>
<div id="calendarEvent">
<div id="dateBox">
<span id="calendarMonth">{{start_date_MMM}}</span>
<span id="calendarDay">{{start_date_D}}</span>
</div>
<div id="text-box">
<h2><a href="{{url}}">{{title}}</a></h2>
<p>{{description}}</p>
<span id="time">{{time_duration_text}}</span>
</div>
</div>
<div id="calendarSpacer" ></div>
#protect]]></script></code>
</pre></li>
<li>Move these <code><script></code> tags into an XML
Block(s), which don't undergo the same cleanup/rewriting routines
as Templates</li>
</ul>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-08T14:20:17Z2015-06-08T14:20:17ZI need to prevent Cascade from adding a slash to my code.<div><p>I used the #protect tags, and that did it. Thanks!</p></div>webadmintag:help-archives.hannonhill.com,2010-02-09:Comment/370512202015-06-08T14:25:47Z2015-06-08T14:25:47ZI need to prevent Cascade from adding a slash to my code.<div><p>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.</p>
<p>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.</p>
<p>Have a great day!</p></div>Ryan Griffith