Page 1 of 1
Cannot insert <__script__> to content?
Posted: Sun Jan 24, 2016 8:02 pm
by frank4360
I need to add a Survey Monkey piece of code into the home page of a site, but I cannot enter the
code via the Content Manager>Edit Content Page>Main>Tools using the Source Code facility. If I try to add this code it is ignored.
I assume this is a deliberate restriction, so should I be creating a new Template to add the Survey code, or is there another way?
Thanks in advance!
Re: Cannot insert <__script__> to content?
Posted: Sun Jan 24, 2016 9:13 pm
by Rolf
Disable wysiwyg editor in options tab
Add {literal} tags around the code
Re: Cannot insert <__script__> to content?
Posted: Mon Jan 25, 2016 10:08 am
by frank4360
Rolf wrote:Disable wysiwyg editor in options tab
Add {literal} tags around the code
Hello Rolf
Thanks for the reply; I did as you suggested, cleared cache, cleared cookies on the web page, and there was no change to the page.
The code given to me to post in is as follows (though there are no underscores in the "script" tags):-
Code: Select all
<__script__>(function(e,t,s,n){var o,c,i;e.SMCX=e.SMCX||[],t.getElementById(n)||(o=t.getElementsByTagName(s),c=o[o.length-1],i=t.createElement(s),i.type="text/javascript",i.async=!0,i.id=n,i.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/YEwZziOY4TOOIOrs3w90KWL_2BjsYP46eBSZoBg1ZlD_2BInDs_2BipLji0uVZDFPeMqXc.js"].join(""),c.parentNode.insertBefore(i,c))})(window,document,"script","smcx-sdk");</__script>
Have you any thoughts?
Thanks
Frank
Re: Cannot insert <__script__> to content?
Posted: Mon Jan 25, 2016 10:15 am
by velden
Is the code allowed to be in the head section of the html?
If you used the {metadata} tag in the template consider put this code in the 'Page specific metadata' field on the Options tab of your page.
Re: Cannot insert <__script__> to content?
Posted: Tue Jan 26, 2016 5:39 pm
by frank4360
velden wrote:Is the code allowed to be in the head section of the html?
If you used the {metadata} tag in the template consider put this code in the 'Page specific metadata' field on the Options tab of your page.
I tried the Page Specific Metadata as suggested and it did not work, but now I have added the code into the "Smarty data or Logic specific to this page", and it works.
When I say that "it did not work" - because the code I am adding is to display a Survey Monkey pop-up, which seems to check not just cookies but also the IP Address of the computer to restrict the pop-up to one attempt, I cannot be absolutely certain that the code insertion has not worked when placed elsewhere. I have been clearing cookies and using a number of different computers, browsers and operating systems. However, I am now happy that it is working inserted as described.
Thanks for all the ideas.
Frank