tag:help-archives.hannonhill.com,2010-02-09:/discussions/general/515-xhtml-keeps-changing-my-javascript-pass-through-code-is-not-workingCascade CMS: Discussion 2018-10-18T20:36:28Ztag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-02-09T23:05:27Z2012-02-09T23:05:27Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>I usually either have it as a separate .js file or put it in a
text block and apply that block to a region just before the closing
body tag. I've created regions called "script1" and "script2" so
that, when a page needs custom JavaScript, I can easily put the
JavaScript text block in one of those.</p></div>Eric L. Eppstag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-03-20T13:22:53Z2012-03-20T13:22:53Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>Following up with some older posts.</p>
<p>I also use external Javascript files when possible.</p>
<p>When I'm using an XHTML Block for Javascript, I usually turn off
HTML Tidy. Because of this, I usually use an XML Block instead
depending on the content I'm trying to store. If you're trying to
submit only Javascript (or even a small amount of straight HTML) I
would use an XML Block. I think it's great for entering HTML
content that wouldn't lend itself to being managed through the
WYSIWYG interface.</p>
<p>Hope this helps.</p></div>Charlie Holdertag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-05-30T20:11:56Z2012-10-15T15:14:52Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>Is there any way to get the CMS to recognize image links inside
of a javascript file?</p>
<p>If I use a document.write(image link).</p>
<p>Steve</p></div>ssuhtag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-05-30T21:03:32Z2012-05-30T21:03:32Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>Yes, File assets have "Rewrite links in file" checkbox that
needs to be checked first. Then, anything that is a link to another
File or Page needs to be wrapped in [system-asset] tags. For
example:</p>
<p>
<code>document.write('[system-asset]/path/to/file.jpg[/system-asset]')</code></p></div>Arturtag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-05-30T21:12:14Z2012-10-15T15:14:53Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>Does it work with string concatentation?</p>
<p>document.write('[system-asset]<img src=
"/_assets/images/mastheads/general/'%20+%20images[foo]%20+'%20[/system-asset]'+%20'"
title="' + alt[foo] + '" alt="' + alt[foo] + '">');</p>
<p>Steve</p></div>ssuhtag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-05-30T21:26:17Z2012-05-30T21:26:17Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>No, between [system-asset] tags there must be path only. No
<code><img></code> tag or anything concatenated. The only
place that concatenation can occur is formats. For example, this
will work:</p>
<pre>
<code>#set( $s = 'starting' )
[system-asset]/${s}-page[/system-asset]</code>
</pre>
<p>and will show a link to /starting-page correctly updated.
However, even in this case, the link will not be managed by Cascade
Server so that if you move or rename that page, the link will
become broken.</p>
<p>However, if you have full path between [system-asset] tags, then
that link will be managed by Cascade Server so that if you move or
rename the linked-to asset, the link itself will get automatically
updated.</p></div>Arturtag:help-archives.hannonhill.com,2010-02-09:Comment/135691182012-05-30T21:30:55Z2012-10-15T15:14:53Zxhtml keeps changing my javascript, pass-through code is not working.<div><p>Thanks. We have a random image masthead with some javascript. It
justs a document write to an image src with an array.</p>
<p>I guess we'll have to rethink this...</p>
<p>Steve</p></div>ssuh