Hi everyone
I am tring to put data from a server on a partner site into my silverstripe site by putting the following into a table cell: <script type="text/javascript" src="http://gpersonal.vo.llnwd.net/api/badge/js"></script>
To do this I have tried the following without success. Can anyone offer any ideas as to how I might do this.?
I have copied the HtmlEditorConfig statement from cms/_config.php to mysite/_config.php and added the following to the HtmlEditorConfig in mysite/_config.php
form[action|accept|accept-charset|enctype|method],
option[disabled|label|selected|value],
script[src|type],
select[disabled|multiple|name|size],
input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],
If I then put the following into the cell of a table using the html option in the wysiwyg editor
<table>
<tr>
<td>
style type="text/css">
#wld_badge_wrapper { border: 1px solid black; width: 420px; overflow: hidden; }
#wld_badge_inner { padding: 10px 0 10px 10px; }
.wld_badge_item { float: left; margin: 0 10px 0 0; padding: 0; }
.wld_badge_item img { border: 1px solid black; }
.wld_badge_item_detail { margin-top: 5px; font-size: 75%; width: 90px; overflow: hidden; }
.wld_badge_clear { clear: both; }
</style>
<div id="wld_badge_wrapper">
<div id="wld_badge_inner">
<script type="text/javascript" src="http://gpersonal.vo.llnwd.net/api/badge/js"></script>
<div class="wld_badge_clear" />
</div>
</div> </td>
Then press Insert
If I go back to look at html it has been changed to this:
style type="text/css"> #wld_badge_wrapper { border: 1px solid black; width: 420px; overflow: hidden; } #wld_badge_inner { padding: 10px 0 10px 10px; } .wld_badge_item { float: left; margin: 0 10px 0 0; padding: 0; } .wld_badge_item img { border: 1px solid black; } .wld_badge_item_detail { margin-top: 5px; font-size: 75%; width: 90px; overflow: hidden; } .wld_badge_clear { clear: both; }
<div id="wld_badge_wrapper">
<div id="wld_badge_inner">
<script src="http://gpers.vo.llnwd.net/api/badge/js" type="text/javascript"></script>
<div class="wld_badge_clear"></div>
I have tried creating id and classes in the layout.css and calling them in the html editor but this does not seem to work either. When I do this it does not like the script statement.
Looking at the documentation for silverstripe it looks like I either need to put
<% require javascript %>
or
Requirements::javascript
somewhere, but I am not sure where.
Would this resolve my problem or is it my bad coding.
Can anyone help on this?
Paul