tentapress / custom-blocks
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/tentapress/custom-blocks
Requires
- php: ^8.2
- tentapress/blocks: <1.0
- tentapress/system: <1.0
README
Single-file block discovery for active TentaPress themes.
Plugin Details
| Field | Value |
|---|---|
| ID | tentapress/custom-blocks |
| Version | 0.1.1 |
| Provider | TentaPress\\CustomBlocks\\CustomBlocksServiceProvider |
What It Does
- 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
Block File Format
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>
Metadata behavior
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.
Commands
php artisan tp:plugins sync
php artisan tp:plugins enable tentapress/custom-blocks
php artisan tp:plugins cache