hyva-cms-custom-field
БесплатноБез исполняемых скриптовНе проверенCreate custom field types and field handlers for Hyvä CMS components. Use when the user mentions Hyvä, Hyva, or CMS together with custom field, custom input…
от hyva-themes★ 86 звёзд на GitHubОб этом скилле
Hyvä CMS Custom Field Type Creator
Overview
This skill guides the creation of custom field types and field handlers for Hyvä CMS components. Custom field types extend the built-in field types (text, textarea, select, etc.) with specialized input controls for the CMS editor interface.
Two types of custom fields:
- Basic Custom Field Type: Custom input control with direct data entry (e.g., date range, color picker, custom validation)
- Field Handler: Enhanced UI with complex interactions (e.g., product selector with images, searchable dropdown, link configuration modal)
Command execution: For commands that need to run inside the development environment (e.g., bin/magento), use the hyva-exec-shell-cmd skill to detect the environment and determine the appropriate command wrapper.
Skill deps (read via <skill_path>/../{name}/SKILL.md, where <skill_path> is the directory containing this SKILL.md file): hyva-exec-shell-cmd, hyva-create-module
Non-interactive runs: If the user cannot be asked (subagent or non-interactive run), take the inputs from the request. Stop and report what is missing if the target module (or the vendor and module name for a new module), the field type name or its purpose were not given. Choose the UI pattern, data structure and validation from the stated purpose, and state the choices in the final report.
Workflow
Step 1: Module Selection
If not already specified in the prompt, determine where to create the custom field type:
Option A: New Module
Use the hyva-create-module skill with:
dependencies:["Hyva_CmsBase", "Hyva_CmsLiveviewEditor"]composer_require:{"hyva-themes/commerce-module-cms": "^1.0"}
Option B: Existing Module
Verify the module has required dependencies:
Hyva_CmsBaseandHyva_CmsLiveviewEditorinetc/module.xmlhyva-themes/commerce-module-cmsincomposer.json
Add missing dependencies if needed.
Step 2: Field Type Details
Gather information about the custom field type:
- Field type name (lowercase identifier, e.g.,
date_range,product_selector,color_picker) - Purpose (what data does it collect?)
- UI pattern:
- Basic field: Simple input with validation (date picker, pattern input, enhanced text field)
- Inline handler: Enhanced control in field area (searchable dropdown, color picker)
- Modal handler: Separate dialog for complex selection (product selector, link builder, media gallery)
- Data structure (simple string, JSON object, array?)
- Validation requirements (pattern, required, custom rules?)
Step 3: Implementation Pattern Selection
Based on the UI pattern identified in Step 2:
Pattern A: Basic Custom Field Type
For simple inputs with custom HTML5 validation or specialized input controls:
- Single template file for the field
- No separate handler modal
- Example: Date range selector, custom pattern validation, slider input
Pattern B: Inline Field Handler
For enhanced controls that remain in the field area:
- Single template file with Alpine.js component
- No separate handler modal
- Example: Searchable select dropdown, color picker with swatches
Pattern C: Modal-Based Field Handler
For complex selection interfaces requiring more space:
- Field template (displays selection + trigger button)
- Handler modal template (separate dialog with full UI)
- Layout XML registration for the handler
- Example: Product selector, link configuration, media gallery
See references/handler-patterns.md for detailed implementation patterns and code examples for each type.
Step 4: Generate Field Template
Create the field template at view/adminhtml/templates/field-types/[field-type-name].phtml.
Required template elements:
- Field container with proper ID:
field-container-{uid}_{fieldName} - Input element(s) with name:
{uid}_{fieldName} - Validation messages container:
validation-messages-{uid}_{fieldName} updateWireField()orupdateField()call on value change- Error state handling via
$magewire->errors - IMPORTANT: Use null coalescing for field value:
$block->getData('value') ?? ''(NOT type casting)
Use the appropriate template from assets/templates/:
basic-field.phtml.tpl- Basic custom field typeinline-handler.phtml.tpl- Inline enhanced controlmodal-field.phtml.tpl- Modal handler field template
See references/template-requirements.md for detailed template requirements and patterns.
Step 5: Generate Handler Modal (if needed)
For modal-based handlers only, create the handler template at view/adminhtml/templates/handlers/[handler-name]-handler.phtml.
Handler modal structure:
<dialog>element with Alpine.js component andopen:flexclass (NOT staticflex)- Listen for initialization event from field template
- Implement selection UI (search, filters, grid, etc.)
- Dispatch
editor-changeevent on save
Use `assets/templates/
Установить hyva-cms-custom-field в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл hyva-cms-custom-field?
Create custom field types and field handlers for Hyvä CMS components. Use when the user mentions Hyvä, Hyva, or CMS together with custom field, custom input, or modal selector (e.g. hyva custom field, custom cms field, hyva modal selector, custom hyva input, custom cms input). Do not use for generic form or UI work outside Hyvä CMS.
Как установить скилл hyva-cms-custom-field?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hyva-cms-custom-field запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic