Single-file block discovery for active TentaPress themes.
| Field | Value |
|---|---|
| ID | tentapress/custom-blocks |
| Version | 0.1.1 |
| Provider | TentaPress\\CustomBlocks\\CustomBlocksServiceProvider |
- Scans the active theme at
views/blocks/**/*.blade.php - Registers only files that include valid block metadata in a
tp:blockBlade comment - Registers definitions into the
BlockRegistry - Makes discovered blocks available in the existing blocks editor
Create a block file in your active theme, for example:
themes/<vendor>/<theme>/views/blocks/pricing.blade.php
{{-- tp:block
{
"name": "Pricing",
"description": "Tiered pricing cards",
"fields": [
{ "key": "headline", "label": "Headline", "type": "text" },
{ "key": "plans", "label": "Plans JSON", "type": "textarea", "rows": 8 }
],
"defaults": {
"headline": "Pricing",
"plans": []
}
}
--}}
<section>
<h2>{{ $props['headline'] ?? '' }}</h2>
</section>tp:blockmetadata is required for a file to be registered as a custom block.typeis optional. If omitted, it defaults totentapress/custom-blocks/<file-slug>.viewis optional. If omitted, it defaults toblocks.<relative.path>.nameanddescriptionfallback automatically if omitted.fields,defaults,variants, anddefault_variantfollow the same shape as JSON block definitions.
php artisan tp:plugins sync
php artisan tp:plugins enable tentapress/custom-blocks
php artisan tp:plugins cache