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.

Widgets

Discuss SilverStripe Widgets.

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

HTMLTextField in Widget


Reply

16 Posts   4540 Views

Avatar
swaiba

18 January 2012 at 11:19pm Forum Moderator, 1796 Posts

I just read that (btw the link isn't correctly linking in your article) but it wasn't clear to me whether you have used that code and "hacked the core" - did you hack the core?

Also how are the other functions that are added to TinyMCE handled - for instance inserting a link to another ss page?

btw I am intrested in this, but without hacking the core and providing all TinyMCE functions, until then I'll stick to bbcode only and a text edit

Avatar
CHD

18 January 2012 at 11:36pm (Last edited: 18 January 2012 11:36pm), Community Member, 218 Posts

Sorry hadn't quite finished with the article!
check it now...hopefully it's clearer

http://www.clickheredigital.co.uk/blog/bad-widget-class-name-given-our-experience-with-widgets-on-any-silverstripe-page/

Avatar
swaiba

18 January 2012 at 11:42pm Forum Moderator, 1796 Posts

sorry to be a pain but the link in the article "http://groups.google.com/group/silverstripe-dev/msg/1a3b1292c4f46117" still links to "http:"
and the article is advising a replacing a core class yes?

Avatar
CHD

18 January 2012 at 11:46pm Community Member, 218 Posts

oh that link! fixed. thanks for pointing it out.

no we ONLY used the "widgets_content" folder from his link of attachments at the bottom of the page. We didn't make ANY core changes. Or changes to WidgetEditorArea.js.

Avatar
swaiba

18 January 2012 at 11:48pm Forum Moderator, 1796 Posts

hmmm, no core change great! and it handles things link inserting a link the same way tinyMCE in the "normal" use does?

Avatar
CHD

18 January 2012 at 11:55pm Community Member, 218 Posts

yep!

The ONLY draw back is that you still need to save the page when you add a content widget before the TinyMCE applet will load.
But links, images, internal links etc all work fine.

Avatar
Digital-Punk.co.uk

25 January 2012 at 1:06am (Last edited: 25 January 2012 1:06am), Community Member, 51 Posts

To CHD:

I try to implement your plugin, but it seems that .js file is missing in archive. In the ContentWidget.php you have requirement:

Requirements::javascript('widgets_content/ContentWidget.js');

And there is no such file in this folder. Could you check this please? Thanks!

Avatar
CHD

25 January 2012 at 1:16am Community Member, 218 Posts

You're right!
That's odd. Doesn't look like it matters, I just commented it out and all still works fine.
I'll update my .zip files now.

(in case you haven't noticed, this isn't my strong point, so the code may not be great! But it works, so I wanted to share anyway, I'm sure the pros here can clean up these widget packs for general public use!)