Limit selectable widgets in ckeditor


#1

See JIRA issue here: https://presidecms.atlassian.net/browse/PRESIDECMS-527

It would be awesome if the selectable widgets in the rich editor could be limited in any way.
Right now you can either have no widgets or all widgets based on the ckeditor toolbar configuration to be used.
Example scenario: I want to show a simple list of blog teasers in the footer of my website, but don’t want to be able to include a full-blown gallery/slider in that footer, as it simply makes no sense.

Current implementation idea for that would be:

  • optionally include list of selectable widgets in ckeditor toolbar configuration (if not provided all are available)
  • create various toolbar configurations for the various contexts
  • use a specific configuration in that context

Does that make sense? Any further ideas?


#2

The first thing that springs to mind is a ‘widgetContext’ attribute. Something like:

<field name="newsletter_header" control="richeditor" widgetcontext="newsletter" />

and/or:

property name="newsletter_header" type="string" dbtype="text" widgetcontext="newsletter";

#3

I’m going with “widget categories” here for this implementation. So:

<field name="newsletter_body" control="richeditor" widgetcategories="newsletter" />

Widgets can define their categories in their configuration form:

<?xml version="1.0" encoding="UTF-8"?>
<form i18nBaseUri="widgets.newsletterLeadPromo:" categories="newsletter">
    <tab id="default">
        <fieldset id="default" sortorder="10">
            <field name="title" .../>
            <field name="image" .../>
        </fieldset>
    </tab>
</form>

#4

#5

#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.