PHPackages                             sheadawson/silverstripe-shortcodable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sheadawson/silverstripe-shortcodable

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

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

4.0.1(7y ago)4818.2k37[15 issues](https://github.com/sheadawson/silverstripe-shortcodable/issues)[2 PRs](https://github.com/sheadawson/silverstripe-shortcodable/pulls)5BSD LicensePHP

Since Jun 11Pushed 2y ago13 watchersCompare

[ Source](https://github.com/sheadawson/silverstripe-shortcodable)[ Packagist](https://packagist.org/packages/sheadawson/silverstripe-shortcodable)[ Docs](https://github.com/sheadawson/silverstripe-shortcodable)[ RSS](/packages/sheadawson-silverstripe-shortcodable/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (29)Used By (5)

SilverStripe Shortcodable 4
===========================

[](#silverstripe-shortcodable-4)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d4c989395453d147c45c09fbec005617d0719d32562689dba47b97e9fda3315a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73686561646177736f6e2f73696c7665727374726970652d73686f7274636f6461626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sheadawson/silverstripe-shortcodable/?branch=master)

[![Screenshot](https://camo.githubusercontent.com/0bb14d0b494cfb1b2ce0bd5513ee8162e9f7dc812373f2ada92094da273f9f69/68747470733a2f2f7261772e6769746875622e636f6d2f73686561646177736f6e2f73696c7665727374726970652d73686f7274636f6461626c652f6d61737465722f696d616765732f73637265656e73686f742e706e67)](https://camo.githubusercontent.com/0bb14d0b494cfb1b2ce0bd5513ee8162e9f7dc812373f2ada92094da273f9f69/68747470733a2f2f7261772e6769746875622e636f6d2f73686561646177736f6e2f73696c7665727374726970652d73686f7274636f6461626c652f6d61737465722f696d616765732f73637265656e73686f742e706e67)

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

[](#ss4-compatible-version-is-wip-please-submit-prs-if-youd-like-to-help-move-this-along)

What’s working:

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

What’s not working:

- 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.

Requirements
------------

[](#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

Installation
------------

[](#installation)

Install via composer, run dev/build

```
composer require sheadawson/silverstripe-shortcodable

```

Configuration
-------------

[](#configuration)

See [this gist](https://gist.github.com/sheadawson/12c5e5a2b42272bd90f703941450d677) 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.

#### TinyMCE block elements

[](#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.

```
MyShortcodableClass:
  shortcodable_is_block: true
  disable_wrapper: true
```

CMS Usage
---------

[](#cms-usage)

Once installed a new icon will appear in the CMS HTMLEditor toolbar. It looks like this: [![icon](https://camo.githubusercontent.com/42a30cfd71df8744f7954215c7a4f96f2c4574dc18be665c7ce29d0a82dfc609/68747470733a2f2f7261772e6769746875622e636f6d2f73686561646177736f6e2f73696c7665727374726970652d73686f7274636f6461626c652f6d61737465722f696d616765732f73686f7274636f6461626c652e706e67)](https://camo.githubusercontent.com/42a30cfd71df8744f7954215c7a4f96f2c4574dc18be665c7ce29d0a82dfc609/68747470733a2f2f7261772e6769746875622e636f6d2f73686561646177736f6e2f73696c7665727374726970652d73686f7274636f6461626c652f6d61737465722f696d616765732f73686f7274636f6461626c652e706e67)

Clicking the toolbar will open a popup that allows you to insert a shortcode into the editor.

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.

Double clicking a shortcode placeholder in the editor will also open the popup to allow editing of the shortcode.

Upgrading from 1.x
------------------

[](#upgrading-from-1x)

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.

###  Health Score

42

↑

FairBetter than 88% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 68.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~65 days

Recently: every ~38 days

Total

27

Last Release

2704d ago

Major Versions

2.0.6 → 3.0.02016-11-09

2.0.7 → 3.0.22016-12-01

2.0.9 → 3.12017-12-05

3.1.1 → 4.0.02018-09-05

2.0.x-dev → 4.0.x-dev2019-01-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca23b453a4fc5ac237ad4fcc512f68fab5c7b124f403cad1a5848b3fffb6aa2?d=identicon)[sheadawson](/maintainers/sheadawson)

---

Top Contributors

[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (60 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (8 commits)")[![oilee80](https://avatars.githubusercontent.com/u/1453382?v=4)](https://github.com/oilee80 "oilee80 (5 commits)")[![jonom](https://avatars.githubusercontent.com/u/1079425?v=4)](https://github.com/jonom "jonom (4 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (2 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (2 commits)")[![adrexia](https://avatars.githubusercontent.com/u/984753?v=4)](https://github.com/adrexia "adrexia (1 commits)")[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (1 commits)")[![djmattski](https://avatars.githubusercontent.com/u/3836638?v=4)](https://github.com/djmattski "djmattski (1 commits)")[![ec8or](https://avatars.githubusercontent.com/u/1678184?v=4)](https://github.com/ec8or "ec8or (1 commits)")[![lozcalver](https://avatars.githubusercontent.com/u/1655548?v=4)](https://github.com/lozcalver "lozcalver (1 commits)")[![Neumes](https://avatars.githubusercontent.com/u/8358226?v=4)](https://github.com/Neumes "Neumes (1 commits)")[![patjnr](https://avatars.githubusercontent.com/u/435055?v=4)](https://github.com/patjnr "patjnr (1 commits)")

---

Tags

silverstripeshortcode

### Embed Badge

![Health badge](/badges/sheadawson-silverstripe-shortcodable/health.svg)

```
[![Health](https://phpackages.com/badges/sheadawson-silverstripe-shortcodable/health.svg)](https://phpackages.com/packages/sheadawson-silverstripe-shortcodable)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
