Download the PHP package dynamic/silverstripe-elemental-templates without Composer
On this page you can find all versions of the php package dynamic/silverstripe-elemental-templates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dynamic/silverstripe-elemental-templates
More information about dynamic/silverstripe-elemental-templates
Files in dynamic/silverstripe-elemental-templates
Package silverstripe-elemental-templates
Short Description Elemental Templates
License BSD-3-Clause
Informations about the package silverstripe-elemental-templates
Silverstripe Elemental Layouts
A module for Silverstripe CMS that allows CMS users to define reusable page layouts, known as "templates" or "skeletons". These templates provide a predefined set of Elemental blocks that can be used to quickly create pages with consistent layouts and content.
Features
- Predefined Templates: Create reusable templates with predefined Elemental blocks.
- Page Creation from Templates: Quickly create new pages based on existing templates.
- Template Creation from Pages: Generate templates from existing pages, including their Elemental blocks.
- Configurable Defaults: Populate Elemental blocks with default values defined in YAML configuration.
Requirements
- Silverstripe CMS ^5
- DNADesign Elemental module ^5.2
Installation
Install the module via Composer:
Run dev/build
to apply database changes.
Usage
Creating a Template
- Navigate to the "Elemental Templates" section in the CMS.
- Click "Add Template".
- Fill in the template details:
- Title: Name of the template.
- Page Type: Select the page type this template is compatible with.
- Elements: Add Elemental blocks to the template.
- Save the template.
Creating a Page from a Template
- Go to the "Pages" section in the CMS.
- Click "Add Page".
- Select the desired page type.
- In the "Template" dropdown, choose a template to apply to the new page.
- Complete the remaining page details and save.
The selected template's Elemental blocks will be duplicated and added to the new page.
Creating a Template from an Existing Page
- Open the page you want to use as the basis for a template.
- In the "More Options" menu, click "Create Blocks Template".
- A new template will be created with the same Elemental blocks as the page.
- Edit the template as needed in the "Elemental Templates" section.
Populating Template Elements
The module supports pre-populating Elemental blocks with default values. This is configurable via YAML and supports database fields and relationships.
Example YAML Configuration
Note: The $populate
static configuration is checked on the Template
class to determine whether default values should be applied when duplicating elements from a template.
Roadmap
We recognize that the current implementation only supports configuring population definitions for database fields. Expanding this functionality to include other types of data is a priority, and we are actively working on adding this feature to enhance the module's flexibility and usability.
Logging and Debugging
The module logs key actions, such as template creation and Elemental block duplication, to the Silverstripe log file (silverstripe.log
). This can help diagnose issues during development.
Contributing
Contributions are welcome! Please submit a pull request or open an issue on GitHub.
License
This module is licensed under the BSD-3-Clause license. See the LICENSE file for details.
Maintainers
Bugtracker
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.
If the issue does look like a new bug:
- Create a new issue
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.
Development and contribution
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
All versions of silverstripe-elemental-templates with dependencies
dnadesign/silverstripe-elemental Version ^5.0
lekoala/silverstripe-cms-actions Version ^1.7
silverstripe/vendor-plugin Version ^2