GriefCode Posted December 18, 2016 Posted December 18, 2016 Hey, is there anywhere an topic how i can create a custom embed in the ckeditor? Like if im including a topic within a post? I would have basically a link to one of my applications and i would like to display it not as plain link, there should be some info around. Any referencing code would be also nice :-) Thanks
HeadStand Posted December 19, 2016 Posted December 19, 2016 Your content item must implement \IPS\Content\Embeddable. That alone will make your content embeddable from the editor. If you want to customize the layout of the embedded content, you can add the following 2 methods to your class: /** * Get content for embed * * @param array $params Additional parameters to add to URL * @return string */ public function embedContent( $params ) { return \IPS\Theme::i()->getTemplate( 'global', 'core' )->embedItem( $this, $this->url()->setQueryString( $params ), $this->embedImage() ); } /** * Get image for embed * * @return \IPS\File|NULL */ public function embedImage() { return NULL; } The only one you would really need is embedContent, though.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.