Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Storing custom code, E.G - javascript


Go to End


629 Views

Avatar
CHD

Community Member, 219 Posts

24 January 2012 at 5:24am

A client of mine uses javascript banners, and would like to be able to add them manually in the CMS, however SilverStripe always strips out all the " & 's. So it never works. have tried lots all the different data types, but it always escapes the special characters.

is there any way at all to do this?
If the codes followed a similar pattern I would create a template and let the client just add in the URL that changes etc, but the code is always different depending on the banner supplier. here's an example:

 <script language="JavaScript" type="text/javascript" src="***"></script> </head> <body> <div><span id="text1"> </span><br/></div> <div><span id="text2"> </span><br/></div> <script language="JavaScript">
 
 var ticker = new Ticker({info: 1, local: 1, casino: 'europa', game: 'car',currency: 'eur'}); ticker.attachToTextBox('text1'); ticker.tick();
 var ticker2 = new Ticker({info: 4, local: 1, casino: 'titan', currency: 'eur'}); ticker2.attachToTextBox('text2'); ticker2.tick();
 
</script> 

as usual, any help is greatly appreciated!