소스 정보
- 저장소
- Guiziweb/guiziweb-plugins
- 최근 소스 활동
- 2026년 5월 24일 05:14
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Guiziweb/guiziweb-plugins --skill add-grid명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Add an admin autocomplete form type for a Sylius Resource (translatable or not), optionally injected into another form via an extension
Add an admin FormType for an existing Sylius Resource
Add a Sylius admin grid for an existing Sylius Resource
SOC 직업 분류 기준
SKILL.md 표시 중
| name | add-grid |
| description | Add a Sylius admin grid for an existing Sylius Resource |
| argument-hint | [ModelName] |
| allowed-tools | AskUserQuestion, Bash, Read, Edit, Write, Glob, Grep |
Ask the user for the ModelName if not provided. Read src/**/Entity/{ModelName}/{ModelName}.php to detect the entity's fields and relations.
Prerequisite: the model must already exist as a Sylius Resource (run /sylius-plugin:add-model first). To customize an existing Sylius core grid (e.g. sylius_admin_product), use /sylius-plugin:extends-grid instead.
One grid file per resource at config/grids/{model_snake}.yaml at the plugin root (matches AdyenPlugin / MolliePlugin convention). Add the glob import once to the plugin's config/config.yaml: - { resource: "grids/*.yaml" }.
Based on the entity, ask:
show action (requires a show route — run /sylius-plugin:add-routes with a show operation if missing)Grid name convention: ${SYLIUS_PREFIX}_admin_{model_snake}.
sylius_grid:
grids:
${SYLIUS_PREFIX}_admin_{model_snake}:
driver:
name: doctrine/orm
options:
class: "%${SYLIUS_PREFIX}.model.{model_snake}.class%"
sorting:
# Must reference a field declared under `fields:` (the sort key is resolved against field names, not entity columns).
# If you want to sort by id but not display it, declare the `id` field and set `enabled: false`.
limits: [10, 25, 50]
fields:
# see §4
filters:
# see §5
actions:
# see §6
Translatable resource? Extend driver.options so the grid query joins translations under alias translation (the custom repository from /sylius-plugin:add-translatable-model is consumed only when you ask for it explicitly — same pattern as sylius_admin_product_option):
driver:
name: doctrine/orm
options:
class: "%${SYLIUS_PREFIX}.model.{model_snake}.class%"
repository:
method: createListQueryBuilder
arguments: ["expr:service('sylius.context.locale').getLocaleCode()"]
The only valid grid field types are string, datetime, enum, twig, and callable.
| Doctrine type / use case | Grid type | Notes |
|---|---|---|
string, text, integer | string | plain display — integer on the entity still maps to grid type string |
datetime, date | datetime | option format (default Y:m:d H:i:s) |
boolean | twig | template @SyliusUi/Grid/Field/enabled.html.twig |
| Relation property (ManyToOne) | string with path: relation.property | e.g. author.username |
| Translatable field | string (no path:) | display falls back on the PHP getter, which delegates to getTranslation(). For SQL sort use sortable: translation.{field}. The grid driver must also call the locale-aware list builder — see §3 above. Pattern: sylius_admin_product_option. |
| Complex / multi-property render | twig with path: . | full object available as {{ data.* }} in template |
Common options on every field:
label: ${SYLIUS_PREFIX}.grid.{model_snake}.{field} — translation keysortable: ~ — enable sorting using this field's name as the sort path; use sortable: some.path to sort by a different column (useful with type: twig)position: N — display order (lower = earlier)Examples:
fields:
title:
type: string
label: ${SYLIUS_PREFIX}.grid.{model_snake}.title
sortable: ~
enabled:
type: twig
label: ${SYLIUS_PREFIX}.grid.{model_snake}.enabled
options:
template: '@SyliusUi/Grid/Field/enabled.html.twig'
author:
type: string
label: ${SYLIUS_PREFIX}.grid.{model_snake}.author
path: author.username
createdAt:
type: datetime
label: ${SYLIUS_PREFIX}.grid.{model_snake}.created_at
sortable: ~
options:
format: 'd-m-Y H:i'
| Use case | YAML |
|---|---|
| Single text field | type: string |
| Multi-field search | type: string + options.fields: [field1, field2] |
| Force one operator | form_options.type: contains (see note below) |
| Boolean flag | type: boolean |
| Date range | type: date |
| Related entity (small table) | type: entity + form_options.class: '%…model…class%' |
| Enum / choice list | type: select + form_options.choices: { label: value, … } |
| Field has any value | type: exists + options.field: {field} |
| Money range | type: money + options.currency_field: currencyCode |
String filter operators (for form_options.type:): contains, not_contains, equal, not_equal, starts_with, ends_with, empty, not_empty, in, not_in, member_of.
Useful options:
default_value: true — pre-fill the filter (e.g. enabled-only view by default)enabled: false — hide a filter inherited from a parent gridFor translatable fields: a string filter targeting a field defined on the *Translation entity must spell out the DQL path — options.fields: [translation.{field}]. Without it, Doctrine throws "field has no field named title" because the column lives on the join, not the root entity.
For an AJAX autocomplete filter on a related entity, Sylius ships two ready-to-use filter types — you do not need a custom filter class or to call /sylius-plugin:add-autocomplete:
ux_translatable_autocomplete — for entities with a translatable label (e.g. Taxon.name, Library.name)ux_autocomplete — for non-translatable entitiesfilters:
library:
type: ux_translatable_autocomplete
label: ${SYLIUS_PREFIX}.grid.{model_snake}.library
form_options:
multiple: false
extra_options:
class: '%${SYLIUS_PREFIX}.model.library.class%'
translation_fields: [name]
choice_label: name
options:
fields: [library.id] # DQL path used by the filter, usually `{relation}.id`
Reserve /sylius-plugin:add-autocomplete for exposing an autocomplete in a form — grid filters do not need it.
Examples:
filters:
search:
type: string
label: ${SYLIUS_PREFIX}.grid.{model_snake}.search
options:
fields: [title, description]
enabled:
type: boolean
label: ${SYLIUS_PREFIX}.grid.{model_snake}.enabled
default_value: true
createdAt:
type: date
label: ${SYLIUS_PREFIX}.grid.{model_snake}.created_at
author:
type: entity
label: ${SYLIUS_PREFIX}.grid.{model_snake}.author
form_options:
class: '%sylius.model.admin_user.class%'
actions:
main:
create:
type: create
item:
update:
type: update
delete:
type: delete
# show: # uncomment if a show route exists
# type: show
# options:
# link:
# route: ${SYLIUS_PREFIX}_admin_{model_snake}_show
# parameters:
# id: resource.id
bulk:
delete:
type: delete
Other built-in types (use when relevant):
show (item) — read-only page; requires a show routearchive (item, bulk) — soft-delete workflow; entity must implement ArchiveInterface, supports restore_labelapply_transition (item, bulk) — workflow state machine transitionFor a per-row dropdown grouping several links (e.g. "Manage children"), use a subitem action group with type: links and a list of links: (each with route, parameters, optional visible: resource.hasXxx expression).
Get the project's default locale:
vendor/bin/console debug:container --parameter=kernel.default_locale
Add labels to translations/messages.{locale}.yaml. Grid field labels use the grid.{model_snake}.{field} namespace (keeps ${SYLIUS_PREFIX}.ui.* free for Sylius's auto-generated scalar keys like ${SYLIUS_PREFIX}.ui.{model_snake} used for page titles/breadcrumbs).
${SYLIUS_PREFIX}:
grid:
{model_snake}:
title: Title
enabled: Enabled
created_at: Created at
search: Search
vendor/bin/console cache:clear
vendor/bin/console sylius:debug:grid ${SYLIUS_PREFIX}_admin_{model_snake} prints the grid definition (fields, filters, actions as declared)vendor/bin/console debug:translation {locale} --domain=messages 2>&1 | grep '${SYLIUS_PREFIX}.grid.{model_snake}' lists every label you added./sylius-plugin:add-routes/sylius-plugin:add-menu