tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/236-using-an-embed-code-from-a-data-definitionCascade CMS: Discussion 2013-08-20T03:48:47Ztag:help-archives.hannonhill.com,2010-02-09:Comment/184266542012-09-04T13:50:43Z2012-09-04T13:50:43ZUsing an embed code from a data definition<div><p>Hi Ashley,</p>
<p>If you are running Cascade 6.10+, let's try running the embed
code through the EscapeTool to see if that helps out:</p>
<pre>
<code>#set ( $flickr_slideshow = $content.getChild("flickr-slideshow").value)
$_EscapeTool.html($flickr_slideshow)</code>
</pre>
<p>By using the HTML escape method, hopefully the HTML will be
encoded properly and the error will go away.</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/184266542012-09-04T17:43:27Z2012-09-04T17:43:27ZUsing an embed code from a data definition<div><p>Hi Ryan,</p>
<p>It looks like using the EscapeTool got rid of the error, but it
ends up putting the code on the page as text.</p>
<p>I've attached the article format and xml for context.</p></div>Ashley Williamstag:help-archives.hannonhill.com,2010-02-09:Comment/184266542012-09-04T18:56:10Z2012-09-04T18:56:10ZUsing an embed code from a data definition<div><p>Thank you for the follow up and attaching the files for
reference. Let's try the attached Velocity and see if that
helps.</p>
<p>The two lines I updated were:</p>
<pre>
<code>#set ( $flickr_slideshow = $content.getChild("flickr-slideshow"))
$_SerializerTool.serialize($flickr_slideshow,true)</code>
</pre>
<p>I believe you had something similar initially, but instead of
passing <em>true</em> into the serializer, you had
<em>false</em>.</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/184266542012-09-04T18:56:52Z2012-09-04T18:56:52ZUsing an embed code from a data definition<div><p>My apologies, I forgot to attach the file.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/184266542012-09-04T19:47:33Z2012-09-04T19:47:33ZUsing an embed code from a data definition<div><p>Hi Ryan,</p>
<p>Still the same issue (it outputs as text instead of code) with
the change you made. I think I may have tried the same thing (using
true instead of false) on Friday.</p>
<p>Maybe I'm not choosing the right method for having them paste in
the embed code? In the data definition I'm using a multi-line
textbox:</p>
<pre>
<code><text multi-line="true" identifier="flickr-slideshow" label="Flickr Slideshow" help-text="Paste the embed code for the Flickr Slideshow here"/></code>
</pre></div>Ashley Williamstag:help-archives.hannonhill.com,2010-02-09:Comment/184266542012-09-04T21:24:57Z2012-09-04T21:24:57ZUsing an embed code from a data definition<div><p>Ah, that was something I was wondering. I think the issue from
my example code was the text box isn't encoding the HTML and the
Format was, resulting in the content being spit out to the
page.</p>
<p>Have you tried the following?</p>
<pre>
<code>#set ( $flickr_slideshow = $content.getChild("flickr-slideshow").value )
$flickr_slideshow.replaceAll("&","&amp;")</code>
</pre>
<p>On a side note, if you change the field to a WYSIWYG and use the
Format from my <a href=
"http://help.hannonhill.com/discussions/velocity-formats/236-using-an-embed-code-from-a-data-definition#comment_18507277">
post above</a> that should fix the issue. The downside here is that
your users will have to paste the code into the HTML Source.</p>
<p>Another, more complicated, option could be to adjust your Data
Definition and Format to build the embed code on the fly, similar
to what is done on <a href=
"http://www.hannonhill.com/kb/Flash/index.html">this page</a> in
our knowledgebase.</p>
<p>It looks like the <strong>flashvars</strong> attribute contains
a few constants <code>offsite=true&lang=en-us</code> plus the
URL to the show minus the Flickr domain at the beginning
<code>photos/valdostastate/sets/72157630730541542/show</code> so it
could be doable.</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/184266542012-09-05T12:18:20Z2012-09-05T12:19:31ZUsing an embed code from a data definition<div><p>
<code>$flickr_slideshow.replaceAll("&","&amp;")</code></p>
<p>That worked! :) I considered the more complicated option, but I
think this method will be easier while we're importing from another
database. Thank you!</p></div>Ashley Williamstag:help-archives.hannonhill.com,2010-02-09:Comment/184266542012-09-05T12:21:10Z2012-09-05T12:21:10ZUsing an embed code from a data definition<div><p>That is great news, Ashley. Glad to her we got it working.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to reply or comment to re-open this discussion if you have any
additional questions.</p>
<p>Thanks.</p></div>Ryan Griffith