Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

shortcode GUI in TinyMCE


Go to End


3 Posts   2118 Views

Avatar
Tuckie

Community Member, 10 Posts

13 September 2011 at 3:40am

Is there a proper, pluggable way to create a GUI for shortcodes in TinyMCE (Much like the insert link sidebar)?

I found an example here http://chillburn.com.au/demos/code-differences-wysiwyg-editor/ that seems to be on the right track, but requires modifying the core files, which doesn't seem like the best route.

Creating the TinyMCE plugin with button is easy, but things get murky due to the hard coding in LeftAndMain.ss and HTMLEditorField.php

Is there a best way to add a new right side element?

Ultimately, I'm looking to create a rightside selector for files, that uses ID rather than simply embedding the path in an href.
This would allow the shortcode to display more of the file properties, such as size, date modified etc.

Thanks in advance!

Avatar
SamTheJarvis

Community Member, 24 Posts

5 October 2011 at 9:11am

I'm also pretty interested in this.

A few CMS' we use do this, ElefantCMS (new) and Sitellite (old as heck!).

I would think something similar to the way the Image panel and Link panel are implemented, but I have no idea if that's easily replicated/extendable. Oh you just said that, well, reinforcing the point.

Avatar
Howard

Community Member, 215 Posts

6 October 2011 at 5:47pm

Unfortunately there isn't an easy way to do this - I once looked into creating another right side panel but gave up pretty quick. That is getting an overhaul in SS 3 (see design here https://github.com/silverstripe/silverstripe-design/blob/master/Design/ss3-ui_insert-link.jpg) but I'm unsure how they are implementing it and how pluggable it will be.