21487 Posts in 5783 Topics by 2621 members
| Go to End | ||
| Author | Topic: | 2705 Views |
-
Re: iframes and tinyMCE

12 November 2011 at 7:20pm
An alternative is to use shortcodes, something I learned about after contributing this this thread.
There's a tutorial over at SS Bits which covers YouTube as an example here: http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/
-
Re: iframes and tinyMCE

16 June 2012 at 12:38am
I have followed the instructions but cannot get this to work. I have added the code to Page.php as below
<?php
class Page extends SiteTree {
public static $db = array();
public static $has_one = array();
function onBeforeWrite() {
$this->Content = preg_replace('|<iframe(.*)/>|Uims', '<iframe\\1> </iframe>', $this->Content);
parent::onBeforeWrite();
}
public function getCMSFields()
{
$fields = parent::getCMSFields();//Remove Reports/todo tabs
$fields->removeByName("To-do");
$fields->removeByName("Reports");return $fields;
}
}but I just get an error when I do a dev/build?
Can anybody help?
| 2705 Views | ||
| Go to Top |

