2017 © Pedro PelĂĄez
 

silverstripe-module silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

image

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

  • Friday, December 8, 2017
  • by sheadawson
  • Repository
  • 13 Watchers
  • 43 Stars
  • 10,302 Installations
  • PHP
  • 8 Dependents
  • 4 Suggesters
  • 27 Forks
  • 17 Open issues
  • 28 Versions
  • 3 % Grown

The README.md

SilverStripe Shortcodable 4

Scrutinizer Code Quality, (*1)

Screenshot, (*2)

SS4 compatible version is WIP. Please submit PRs if you'd like to help move this along!

What’s working:, (*3)

  • The TinyMCE button/popup
  • The form in the popup dialog

What’s not working:, (*4)

  • Placeholders
  • Editing an existing shortcode
  • Probably other things

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views. This allows CMS users to easily embed and customise DataObjects and templated HTML snippets anywhere amongst their page content. Shortcodes can optionally be represented in the WYSIWYG with a custom placeholder image., (*5)

Requirements

  • SilverStripe 4 +

See 3.x branch/releases for SilverStripe SS 3.5 compatibility See 2.x branch/releases for SilverStripe SS 3.1 - 3.4 compatibility, (*6)

Installation

Install via composer, run dev/build, (*7)

composer require sheadawson/silverstripe-shortcodable

Configuration

See this gist for a well documented example of a Shortcodable ImageGallery to get you started. This example is for a subclass of DataObject. If your shortcodable object doesn't need it's own database record, you can use the same example but use ViewableData as the parent class., (*8)

TinyMCE block elements

In SilverStripe 3 shortcodes tend to get wrapped in paragraph elements, which is a problem if your shortcode will be rendered as a block element. To get around this you can flag shortcodable classes as block elements with a config setting. If you don't want to replace the paragraph tag with a div this can be disabled as well., (*9)

MyShortcodableClass:
  shortcodable_is_block: true
  disable_wrapper: true

CMS Usage

Once installed a new icon will appear in the CMS HTMLEditor toolbar. It looks like this: icon, (*10)

Clicking the toolbar will open a popup that allows you to insert a shortcode into the editor., (*11)

Highlighting an existing shortcode tag in the editor before clicking the shortcode icon will open the popup to allow editing of the selected shortcode tag., (*12)

Double clicking a shortcode placeholder in the editor will also open the popup to allow editing of the shortcode., (*13)

Upgrading from 1.x

Shortcodable 2.0 has an improved method for applying Shortcodable to DataObjects. We no longer use an interface, as this didn't allow for Shortcodable to be applied to core classes such as File, Member, Page etc without changing core code. Instead, Shortcodable is applied to your Objects via yml config. Some methods have also changed from statics to normal methods. See updated examples below., (*14)

The Versions

08/12 2017

3.0.x-dev

3.0.9999999.9999999-dev https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

08/12 2017

3.1.1

3.1.1.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

08/12 2017

dev-master

9999999-dev https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

05/12 2017

3.1

3.1.0.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

04/12 2017

dev-micschk-patch-1

dev-micschk-patch-1 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

12/01 2017

4.0.x-dev

4.0.9999999.9999999-dev https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

01/12 2016

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

01/12 2016

2.0.8

2.0.8.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

01/12 2016

2.0.9

2.0.9.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

01/12 2016

3.0.2

3.0.2.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

17/11 2016

2.0.7

2.0.7.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

17/11 2016

3.0.1

3.0.1.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

09/11 2016

3.0.0

3.0.0.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

21/09 2016

2.0.6

2.0.6.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

27/05 2016

2.0.5

2.0.5.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

18/05 2016

2.0.4

2.0.4.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

18/05 2016

dev-controllerfix

dev-controllerfix https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

11/05 2016

2.0.3

2.0.3.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

07/05 2016

2.0.2

2.0.2.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

07/05 2016

32.x-dev

32.9999999.9999999.9999999-dev https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

06/04 2016

2.0.1

2.0.1.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

31/03 2016

2.0.0

2.0.0.0 https://github.com/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

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

31/01 2016

1.0.2

1.0.2.0

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

11/11 2015

1.0.x-dev

1.0.9999999.9999999-dev

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

11/11 2015

1.0.1

1.0.1.0

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

12/03 2015

1.0.0

1.0.0.0

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

09/09 2014

0.1.1

0.1.1.0

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode

11/06 2014

0.1.0

0.1.0.0

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

  Sources   Download

BSD License

The Requires

 

by Shea Dawson

silverstripe shortcode