Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the coder-elementor domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u262393194/domains/codestap.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u262393194/domains/codestap.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u262393194/domains/codestap.com/public_html/wp-includes/functions.php on line 6114
How do you create a custom block controller in Concrete? - Code Stap
How do you create a custom block controller in Concrete?

How do you create a custom block controller in Concrete?

Answer: To create a custom block controller in Concrete CMS, follow these steps:

1. Create a New Package (optional): If you want to organize your custom blocks, create a package via the C5 dashboard or manually structure it in `packages/your_package`.

2. Create Block Files: In `application/blocks/your_custom_block` (or within your package), create the following files:
– `controller.php`: This file contains the block’s logic and methods (e.g., `getBlockTypeDescription()`, `add()`, `edit()`, `view()`).
– `view.php`: This file defines how the block is displayed on the front end.
– `edit.php`: This file allows configuration from the dashboard.
– `add.php`: This file is for block addition settings.

3. Define Block Type: In `controller.php`, define the block type by extending `BlockController`. Set up attributes, actions, and functionality.

4. Implement Methods: Implement the necessary methods (`add`, `edit`, `view`, etc.) to handle the block’s behavior.

5. Install the Block: Use the dashboard or a command to install the block type.

6. Add to Pages: Finally, add the new block to pages through the Concrete CMS editor.

Remember to clear the cache to see your changes!

Related Questions & Topics