PHPackages                             cu-boulder/ucb\_shortcodes - 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. cu-boulder/ucb\_shortcodes

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

cu-boulder/ucb\_shortcodes
==========================

A collection of shortcode plugins for CKEditor

0156[2 issues](https://github.com/CuBoulder/ucb_shortcodes/issues)JavaScript

Since Oct 8Pushed 4y ago2 watchersCompare

[ Source](https://github.com/CuBoulder/ucb_shortcodes)[ Packagist](https://packagist.org/packages/cu-boulder/ucb_shortcodes)[ RSS](/packages/cu-boulder-ucb-shortcodes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

ucb\_shortcodes
===============

[](#ucb_shortcodes)

A set of CKEditor plugins to insert short codes

Included shortcodes
-------------------

[](#included-shortcodes)

- Button
- Font Awesome Icon

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

[](#installation)

This module is installed with the profile.

Development
-----------

[](#development)

Extending CKEditor in broken up into two parts, the CKEditor plugin and the Drupal plugin. The Drupal plugin connects the CKEditor plugin to the site. We are using CKEditor 4, so making plugins must adhere to the [CKEditor 4 API](https://ckeditor.com/docs/ckeditor4/latest/guide/index.html).

### CKEditor Plugin

[](#ckeditor-plugin)

Plugins for CKEditor follow a specific directory structure. You can add new plugins to the `plugins` directory.

```
plugin_name
|_ dialogs         // This is where to define modals for the plugin
|_ css             // Optional styles for this plugin. Styles are applied to the modal dialog only
|_ icons           // Contains the button icon that appears on the editor toolbar
|_ plugin.js       // This defines the plugin

```

To create a plugin, read this [Plugin example](https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html). You don't have to add the `config.extraPlugins` part since Drupal will do that.

> The name of the icon image **MUST** match the name of the plugin.
> **Example:**
> The ckeditorfa5 plugin contains an icon called ckeditorfa5.png.
> In the call to `editor.ui.addButton()`, the icon option is also named ckeditorfa5 without the file extension.

### Drupal Plugin

[](#drupal-plugin)

Plugins will extend the `CKEditorPluginBase` class. You can add a new plugin in the `src/Plugin/CKEditorPlugin` directory. Each file must have annotations above the class in order for Drupal to find it.

You can copy an existing Plugin file to create your own. The two important methods in this class are `getFile()` and `getButtons()`. The former will tell Drupal where the actual CKEditor plugin is. The latter will add the button to the editor toolbar.

> The value for the id in the class annotation MUST match the name of the CKEditor plugin name.
> **Example:**
> The ckeditorfa5 plugin defines a new plugin with `CKEDITOR.plugins.add('ckeditorfa5',{})`
> In the IconShortcode.php annotation, the id has the value "ckeditorfa5"

> In the `getButtons()` return array, the key in the associative array **MUST** match the button name in the CKEditor plugin.
> **Example:**
> In IconShortcode.php, the key name is *ckeditorfa*. In ckedortorfa5/plugin.js, the first argument in the call to `editor.ui.addButton()` is also called *ckeditorfa*

---

### Custom Filters

[](#custom-filters)

Filters are applied to the text before it's rendered to the page. You can add new filters in the `src/Plugin/Filter` directory.

There is one method, `process()` where the text is transformed. Make sure to return a new string and not the `$text` variable that's passed into the function. If you're adding classes or additional markup, be sure to add it to the *Allowed HTML Tags* filter option on the text editor config page.

### Stylesheets

[](#stylesheets)

To add CSS to the text editor itself, add CSS files to the `ckeditor_sylesheets` key in [ucb2021\_base.info.yml](https://github.com/CuBoulder/ucb2021_base/blob/main/ucb2021_base.info.yml).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b717634bb237615f360e13a5b1d2efc6f40cb17f77568f8a6401aa978921b4e?d=identicon)[OSRWebDeploy](/maintainers/OSRWebDeploy)

---

Top Contributors

[![brookestevens](https://avatars.githubusercontent.com/u/26030189?v=4)](https://github.com/brookestevens "brookestevens (18 commits)")[![jcsparks](https://avatars.githubusercontent.com/u/12704433?v=4)](https://github.com/jcsparks "jcsparks (2 commits)")[![jnicholCU](https://avatars.githubusercontent.com/u/94021017?v=4)](https://github.com/jnicholCU "jnicholCU (1 commits)")[![tirazel](https://avatars.githubusercontent.com/u/12451503?v=4)](https://github.com/tirazel "tirazel (1 commits)")

### Embed Badge

![Health badge](/badges/cu-boulder-ucb-shortcodes/health.svg)

```
[![Health](https://phpackages.com/badges/cu-boulder-ucb-shortcodes/health.svg)](https://phpackages.com/packages/cu-boulder-ucb-shortcodes)
```

###  Alternatives

[botman/driver-amazon-alexa

Amazon Alexa driver for BotMan

156.9k2](/packages/botman-driver-amazon-alexa)

PHPackages © 2026

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