The SimpleComponents module offers a range of customization features to enhance your templates. With this module, you can effortlessly create repetitive, dynamic template components and directly incorporate them into your page using PHP snippets, for example within a loop. Additionally, you have the flexibility to pass parameters to these components.
This is a straightforward and user-friendly module for creating dynamic and reusable template elements such as cards or other containers. The template components can include code, variables, or text that can be inserted into a template to dynamically display specific template areas.
With this module, you can easily create and customize template elements to suit your needs, allowing for greater flexibility and efficiency in your template design. By leveraging the capabilities of this module, you can enhance the dynamic nature of your templates and provide a seamless user experience.
Instructions for Installing SimpleComponents Module
Download the zip file, unzip it and upload the complete folder
SimpleComponents to your server in the directory
- Log in to the Scriptor editor area.
- Click on "Modules" in the menu.
- Locate the SimpleComponents module and click on the "Install" button.
- If the installation is successful, you should now see an additional item called
Componentsin the navigation menu.
Follow these steps to utilize the SimpleComponents module:
Open the Components menu in the Scriptor editor and create a component similar to the example below:
To use the component in your template, access an instance of the
SimpleComponentsmodule by using the
$components = $site->loadModule('SimpleComponents');
Locate your component by its name. In this example, the component name is
$component = $components->getComponent('author-info');
Define the values to replace the placeholders within the component:
$vars = [ 'TITLE' => 'George Lucas', 'DATE' => '2023-06-22', 'TEXT' => 'George Lucas is an acclaimed American filmmaker, known for creating Star Wars. His groundbreaking work revolutionized cinema.' ];
Finally, output the component:
The output should resemble the following:
Last Updated: 2023-06-21