Jump to:

21487 Posts in 5783 Topics by 2621 members

General Questions

SilverStripe Forums » General Questions » iframes and tinyMCE

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

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2705 Views
  • Chris Hope
    Avatar
    Community Member
    18 Posts

    Re: iframes and tinyMCE Link to this post

    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/

  • Lemonie
    Avatar
    Community Member
    70 Posts

    Re: iframes and tinyMCE Link to this post

    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?

  • Chris Hope
    Avatar
    Community Member
    18 Posts

    Re: iframes and tinyMCE Link to this post

    It would help if you posted the error.

    2705 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.