1171 Posts in 334 Topics by 320 members
Jump to:If this is your first visit, you will need to register before you can post. However, you can browse all messages below.
| Page: 1 | go to end | Reply | |
| Author | Topic: My silverstripe won't let me add HTML CODE! | 972 views |

19 August 2008 at 1:33pm
Hey guys,
Just posting up as having trouble getting html code into the website, I just want to add a Weather Forecast link, but I can't seem to do it!!
http://www.mountbowls.co.nz/blog/
I installed the html widget and it won't let me add any html at all, also I added the script directly using the HTML CODE part of the WYSIWYG editor but it didn't work either!
Can somebody please help me - I appreciate it.
Cheers
Sheldon

20 August 2008 at 10:40pm
What is the code you are trying to add? The CMS HTML editor window only allows basic HTML. We turned off things like Javascript so you can't write that in there by default and things like iframes so you won't be able to write anything like that - (it will just strip it out)

21 August 2008 at 8:58am
I am trying to add
<div style='width: 180px; height: 150px; background-image: url( http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/blue_180x150_bg.jpg ); background-repeat: no-repeat; background-color: #346797;' ><div style='height: 138px;' ><script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=whteYell&logo=0&zipcode=OCN|NZ|NZ000|TAURANGA|&lang=uke&size=8&theme=blue&metric=1&target=_self'></script></div><div style='text-align: center; font-family: arial, helvetica, verdana, sans-serif; font-size: 10px; line-height: 12px; color: #FFFFFF;' ><a style='color: #FFFFFF' href='http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=OCN|NZ|NZ000|TAURANGA|&metric=1' >Weather Forecast</a> | <a style='color: #FFFFFF' href='http://www.accuweather.com/maps-satellite.asp' >Weather Maps</a></div></div>
I need it for my client :)

21 August 2008 at 10:59am
yes adding at will not work.. What you need to do is edit the SS config to allow for script tags by editing the cms/javascript/tinymce.template.js file scroll down to the bottom and there is 2 extended_valid_elements and valid_elements where you can add script and I think if you use valid_elements : "*"; it will allow everything. See http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/128480

21 August 2008 at 2:24pm
Still didn't work, and I changed both to "*"
But even the Blog Module that is made for html code didn't come out as html format, it came out in text format??
Which is really weird??

21 August 2008 at 5:55pm
The blog by default disables TinyMCE and uses BBCode (not a smart idea and I dont like that). If your using a recent version of the blog - available off dailybuilds.silverstripe.com you can use call this in your mysite/_config.php file
Re the change to vaild_elements - if that doesn't work then I have no clue as thats the standard fix for tiny_mce. Make sure it hasn't cached the JS file by clearing your browser cache and visiting http://yoursite.com/admin?flush=1

20 September 2008 at 9:13am
As Willr said, you have to go to cms/javascript/tinymce.template.js file scroll down to bottom and look for "extended_valid_elements". There you can add the elements/tags you would like the editor to accept.
However, DO NOT DELETE THE DATA AND ADD AN ASTERISK SINCE THAT WON'T WORK.
For example, if you would like to include the "style" attribute in a DIV, just add ", div[style]" at the end of "extended_valid_elements". More info can be found at:
wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements

30 September 2008 at 3:26am
That'll work, so you don't need to add every single tag you want to use.
EDIT: The code tag isn't displayed properly:
Last edited: 30 September 2008 at 3:29am
| 972 views | |||
| go to top | Reply |