sheadawson / silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views.
MIT License
48 stars 36 forks source link

Make wrappable shortcodes #73

Closed christohill closed 6 years ago

christohill commented 6 years ago

This might not be the most elegant way to achieve this, but I needed to be able to populate the content for the shortcode from the popup. Creating a field named "Content" adds shortcode content and appends a closing tag.

Example of adding field:

    public function getShortcodeFields() {

        return FieldList::create(
            TextField::create('Content', 'Content')
        );

    }

2

christohill commented 6 years ago

Just realized the content doesn't return to the popup when editing the shortcode. Will revise.