PHPackages                             slonline/silverstripe-calltoaction - 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. slonline/silverstripe-calltoaction

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

slonline/silverstripe-calltoaction
==================================

Silverstripe 4 Module for adding call to action blocks via html editor

6.0.1(4w ago)046proprietaryPHPPHP ^8.3

Since Apr 3Pushed 4w ago1 watchersCompare

[ Source](https://github.com/SLONline/silverstripe-calltoaction)[ Packagist](https://packagist.org/packages/slonline/silverstripe-calltoaction)[ RSS](/packages/slonline-silverstripe-calltoaction/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (10)Versions (11)Used By (0)

SilverStripe 4 Call to Action
=============================

[](#silverstripe-4-call-to-action)

Provides a GUI for CMS users to insert Call to Actions or any Shortcodes into the HTMLEditorField and 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 are represented in the WYSIWYG with their custom HTML content.

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

[](#requirements)

- SilverStripe 4 +

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

[](#installation)

Install via composer, run dev/build

```
composer require slonline/silverstripe-calltoaction

```

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

[](#configuration)

For adding your own Call To Action class, simply define a new class that can be derived from DataObject or ViewableData. A class can implement ShortcodeableInterface interface. Interface defines required methods.

```
class MyCallToAction extends ViewableData implements ShortcodeableInterface
{
    private static $singular_name = 'My Call To Action';
    private static $shortcode = 'mycta';

    public static function parse_shortcode($attributes, $content, $parser, $shortcode): string
    {
        return self::create()->renderWith(self::class);
    }

    public function getCallToActionPlaceHolder($attributes): string
    {
        return self::create()->renderWith(self::class);
    }

    public function singular_name()
    {
        $name = $this->config()->get('singular_name');
        if ($name) {
            return $name;
        }
        return ucwords(trim(strtolower(preg_replace(
            '/_?([A-Z])/',
            ' $1',
            ClassInfo::shortName($this)
        ))));
    }

    /**
     * Custom fields for Call To Action form
     *
     * @return FieldList
     */
    public function getShortcodeFields()
    {
        $fields = FieldList::create();
        ...
        return $fields;
    }
}
```

HTML will be rendered via a template.

Add a defined class in application config.

```
Name: CallToActions
---
SLONline\CallToActions\CallToAction:
  calltoaction_classes:
    - MyCallToAction
```

#### TinyMCE block elements

[](#tinymce-block-elements)

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

```
MyCallToAction:
  shortcodable_is_block: true
  disable_wrapper: true
```

Screenshots
-----------

[](#screenshots)

[![Screenshot](./docs/images/cta_in_editor.png)](./docs/images/cta_in_editor.png)[![Screenshot](./docs/images/cta_popup_form.png)](./docs/images/cta_popup_form.png)[![Screenshot](./docs/images/cta_popup_complex_form.png)](./docs/images/cta_popup_complex_form.png)

CMS Usage
---------

[](#cms-usage)

Once installed a new button \[CtA\] will appear in the CMS HTMLEditor toolbar.

Clicking the toolbar will open a popup that allows you to insert a call to action or 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.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~215 days

Recently: every ~0 days

Total

10

Last Release

29d ago

Major Versions

v0.1.5 → 5.x-dev2026-07-21

5.0.0 → 6.0.02026-07-21

PHP version history (3 changes)v0.1.1PHP ^7.1 || ^8

5.x-devPHP ^8.1

6.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4aadb774b5fa6a31dd242a822c365c00e6ce8f1ed3cd1739a379b130d4af3b9f?d=identicon)[odraska](/maintainers/odraska)

---

Top Contributors

[![odraska](https://avatars.githubusercontent.com/u/775571?v=4)](https://github.com/odraska "odraska (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slonline-silverstripe-calltoaction/health.svg)

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

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5153.7M1.4k](/packages/silverstripe-cms)[symbiote/silverstripe-advancedworkflow

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

46304.8k9](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/userforms

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

1321.1M94](/packages/silverstripe-userforms)[dnadesign/silverstripe-elemental

Elemental pagetype and collection of Elements

1101.1M340](/packages/dnadesign-silverstripe-elemental)[silverstripe/admin

SilverStripe admin interface

272.8M403](/packages/silverstripe-admin)[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

37359.9k36](/packages/lekoala-silverstripe-cms-actions)

PHPackages © 2026

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