Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 18, 20168 yr 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
December 19, 20168 yr 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.
Archived
This topic is now archived and is closed to further replies.