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

Simple javascript question


Go to End


2 Posts   740 Views

Avatar
tomjohn

Community Member, 19 Posts

19 July 2014 at 8:30am

I have site with a few partnership programs. A part of them are simples codes as

<script type="text/javascript" src="http://imps.cardsynergy.com/imps_single_offer.php?&sid=18920&aid=126081&cid=22189517"></script>

I can put in ss file and it work excellent as you can see on page: http://www.bankernews.com/silver/credit-cards/ (block with Discovery card). I need put this and other codes to text fields in articles. Its not so easy because code is broken. I check in base , there is ok, but on site:

&lt;script type="text/javascript" src="http://imps.cardsynergy.com/imps_single_offer.php?&amp;sid=18920&amp;aid=126081&amp;cid=22189517 "&gt;&lt;/script&gt;

Anyone know solution?

Avatar
tomjohn

Community Member, 19 Posts

19 July 2014 at 8:56am

I changed field type to HtmlText and it's works!!

For other which looking for solution my code is:

private static $db = array(	  
    'Advertise'	=>	'HtmlText'   
	);

and

function getCMSFields() 

	{
...
$fields->push(new TextareaField('Advertise', 'Advertise: '));
return $fields;