Building blocktypes
Skill MacareuxDigital/concretecms-skills/building-blocktypes
Agent Skills for Concrete CMS
npx -y skills add MacareuxDigital/concretecms-skills --skill building-blocktypesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Create and manage Concrete CMS block types. Use this skill when the user asks to create or modify custom block types.
SKILL.md
1.5 KB, as published. Nobody here has run it
Building Block Types
Block types are the fundamental units of content in Concrete CMS. They allow users to add different types of content (text, images, forms, etc.) to pages.
Basic Workflow for Block Type Development
- Define the Block Type Directory:
- If in a package:
packages/your_package/blocks/block_handle/ - If in application:
application/blocks/block_handle/
- If in a package:
- Create the Controller:
- Create
controller.phpin the block directory.
- Create
- Create the View:
- Create
view.phpfor the public output.
- Create
- Create Add/Edit Forms:
- Create
add.phpandedit.phpfor the dashboard interface. - These files typically include
form.php:<?php $this->inc('form.php'); ?> - Do not forget these files, as they are required for the block to be added or edited in the CMS.
- Create
- Create the Form Template:
- Create
form.phpwhich is shared by bothadd.phpandedit.php.
- Create
- Define Database Schema:
- Create
db.xml(Doctrine XML format) to define the block's data table. - Refer to the
working-with-databaseskill for the XML format.
- Create
- Register the Block Type:
- Install via Dashboard or programmatically in a package
install()method.
- Install via Dashboard or programmatically in a package