Download the PHP package s2hub/silverstripe-cms-popup without Composer

On this page you can find all versions of the php package s2hub/silverstripe-cms-popup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-cms-popup

silverstripe-cms-popup

Opens modal dialogs in the SilverStripe CMS from a button in the form action menu. Four built-in content types: Search (search with result selection), Batch (sequential processing of a queue), Content (generic HTML loader), and FormSchema (full SilverStripe form including HTMLEditorField).

Requirements: SilverStripe 6, PHP 8.2+


Installation

The module registers itself automatically in LeftAndMain. No additional YAML configuration required.


Search modal

Opens a dialog with a server-rendered search form. The user enters search terms; results are loaded via AJAX. Clicking a result fires a cms-modal:select event on the triggering button.

Create a handler class that extends CmsPopupSearchHandler:

The search endpoint is routed automatically via CmsPopupSearchRouterController at cms-search/.

autoSearch and initialQuery

Listening to the select event


Batch modal

Opens a dialog with a configuration form. After clicking "Start", queue items are sent one by one to an action endpoint; progress is displayed live.

The batch endpoints are routed automatically via CmsPopupBatchRouterController at cms-batch/.

Queue endpoint

getQueueItems() is called when a field named recursive is checked in the batch form. Items are merged with any static queue set via setBaseQueue(). Items with "enabled": false are skipped.

Action endpoint

processItem() is called via POST for each queue item. The request body contains the queue item merged with the form values as JSON:

Response helpers

Method HTTP status Modal display
success($message, $details) 200 green check
warning($message, $details) 200 yellow warning
error($message, $details) 422 red cross

Detail severity: info (green), warning (yellow), error (red).


FormSchema modal

Opens a full SilverStripe form in the modal using FormBuilderLoader. Supports all CMS field types including HTMLEditorField (TinyMCE). The modal closes automatically after a successful save.

Create a handler class that extends CmsPopupHandler:

The form endpoint is routed automatically via CmsPopupAdminController at /admin/cms-popup/popup.

GridField column

Use CmsPopupGridFieldColumn to add a per-row popup button to a GridField:

After a successful save, the GridField is automatically reloaded.


Content modal

Loads arbitrary HTML from a URL into the dialog.


Button icon

A SilverStripe admin font-icon class can be added to any action button:


Modal sizes

Value Width
sm 480 px
md 640 px (default)
lg 860 px

Writing the selected value into a form field

Typical pattern: open search modal → write selected value into a hidden field → save the form.


Custom content components

Register a custom React component via the SilverStripe Injector:

The component receives the props data (from setModalData()), onClose, onSelect, and onSaved.


Building assets

Output: client/dist/js/bundle.js and client/dist/css/cms-popup.css.


All versions of silverstripe-cms-popup with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
silverstripe/framework Version ^6
silverstripe/admin Version ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package s2hub/silverstripe-cms-popup contains the following files

Loading the files please wait ...