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

v0.1.5(5y ago)028proprietaryPHPPHP ^7.1 || ^8

Since Apr 3Pushed 5y 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 yesterday

READMEChangelogDependencies (5)Versions (6)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

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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 ~3 days

Total

5

Last Release

1853d ago

### 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)")

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

5163.4M1.3k](/packages/silverstripe-cms)[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.0M72](/packages/silverstripe-userforms)[silverstripe/subsites

Run multiple sites from a single SilverStripe install.

65392.9k20](/packages/silverstripe-subsites)[undefinedoffset/sortablegridfield

Adds drag and drop functionality to Silverstripe's GridField

941.2M50](/packages/undefinedoffset-sortablegridfield)[symbiote/silverstripe-advancedworkflow

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

46295.2k7](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/tagfield

Tag field for SilverStripe

571.2M45](/packages/silverstripe-tagfield)

PHPackages © 2026

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