Cannot insert <__script__> to content?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
frank4360
Forum Members
Forum Members
Posts: 30
Joined: Fri Jan 28, 2011 9:33 pm

Cannot insert <__script__> to content?

Post 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: Select all

<__script__>
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!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Cannot insert <__script__> to content?

Post by Rolf »

Disable wysiwyg editor in options tab
Add {literal} tags around the code
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
frank4360
Forum Members
Forum Members
Posts: 30
Joined: Fri Jan 28, 2011 9:33 pm

Re: Cannot insert <__script__> to content?

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Cannot insert <__script__> to content?

Post 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.
frank4360
Forum Members
Forum Members
Posts: 30
Joined: Fri Jan 28, 2011 9:33 pm

Re: Cannot insert <__script__> to content?

Post 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
Post Reply

Return to “The Lounge”