taoceanz/silverstripe-instance-shortcodes

Facilitate using shortcodes, but rendered in instance context (rather than static) giving it access to the model data of the page.

Installs: 2 584

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

dev-master 2019-08-11 07:15 UTC

This package is auto-updated.

Last update: 2024-04-11 18:10:53 UTC


README

Description

This extension facilitates accessing properties on a class via a shortcode defined in the CMS, except the shortcode is rendered in instance context giving it access to the model data of the page. This allows defining functions and forms once then re-using them across multiple pages while defining page specific properties for that function or form. Page defined properties can be dynamically displayed in your page and will display when you add your instance shortcode in the CMS.

Example use case

Create a form for Page, then a $db property called form_title. The form is displays on multiple pages via a shortcode definition in the $Content section, but needs to use $form_title to display as a uniquee form title on the page the form displays. Displaying the form via a standard shortcode will not allow you to access form_title uniquely, but display this via an instance shortcode will.

Installation

$ composer require taoceanz/silverstripe-instance-shortcodes

Requirements

  • silverStripe ^4

Maintainers

  • Thomas Ocean

Issues and improvement

If you find an issue, please log and issue If you know of a way to improve this extension, please create a pull request