Form Elements
These widgets all act like form inputs.
These widgets all act like form inputs.
The collection control allows users to collect an ordered list of items. This might be a list of posts from a collection such as products, songs and recipes. To create a collection, the collection 'source' needs to be specified. For example, a collection of songs can be specified like this:
[ 'name' => 'collection', 'controltype' => 'collection', 'source' => 'posts:songs', 'value' => '[]', 'label' => 'Collection', ],
For custom content types, you will need to create a helper. Collection helpers are stored in /Domain/Admin/ObjectLists/. they should have the following two methods
public function view($list) : collection
This method should accept and array of IDs (the collected IDs) and return a collection of objects to be displayed in a list in the admin interface. Each item in this list should have the following properties
The helper should also have a method to return a list of selectable items:
public function options($filter = '', $search = '')
The filter and search are optional parameters to filter the list. Each item in this list should have the same properties that are returned by the view method.
A simple widget to select a page url. Note, unlike the Page Collection widget which collects page IDs, this widget simply collects the page URL.
The page collection widget allows users to collect an ordered list of pages. The data collected is an array IDs