new core element: cards grid with hidden card items child #92

Closed
opened 2026-07-18 02:25:31 +02:00 by dominik.polakovics · 1 comment

What to build

A cards grid element composed via the items-collection pattern (like image/img), edited as IRRE-style rows in the parent form.

scaffold/editor/elements/cards.yaml:

version: 1
label: Cards
group: content
body: { policy: none }
placement: { allowedIn: [page] }
items: { element: card, label: Cards }
params:
  - { name: cols, type: select, label: Columns, default: "3", options: ["2", "3", "4"] }

scaffold/editor/elements/card.yaml (hidden child):

version: 1
label: Card
hidden: true
placement: { allowedIn: [cards] }
summary: heading
params:
  - { name: image, type: image, label: Image }
  - { name: heading, type: text, label: Heading, required: true }
  - { name: text, type: textarea, label: Text }
  - { name: link, type: link, label: Link }

Rendering: responsive card grid honoring cols; when link is set the whole card is clickable (single anchor, honoring the linkTarget companion); image optional, blurb is plain text.

Acceptance criteria

  • Both sidecars + shortcodes ship; card never appears in picker or tree
  • Parent form edits cards as collection rows: add, drag-reorder, collapse, per-row summary shows heading
  • Card with link renders one wrapping anchor (no nested interactive elements); without link, no anchor
  • Grid is responsive: cols is a max, collapsing on narrow viewports like the image grid
  • Publish succeeds via real Hugo build with 0, 1, and many cards

Blocked by

None - can start immediately

## What to build A `cards` grid element composed via the items-collection pattern (like `image`/`img`), edited as IRRE-style rows in the parent form. `scaffold/editor/elements/cards.yaml`: ```yaml version: 1 label: Cards group: content body: { policy: none } placement: { allowedIn: [page] } items: { element: card, label: Cards } params: - { name: cols, type: select, label: Columns, default: "3", options: ["2", "3", "4"] } ``` `scaffold/editor/elements/card.yaml` (hidden child): ```yaml version: 1 label: Card hidden: true placement: { allowedIn: [cards] } summary: heading params: - { name: image, type: image, label: Image } - { name: heading, type: text, label: Heading, required: true } - { name: text, type: textarea, label: Text } - { name: link, type: link, label: Link } ``` Rendering: responsive card grid honoring `cols`; when `link` is set the whole card is clickable (single anchor, honoring the `linkTarget` companion); image optional, blurb is plain text. ## Acceptance criteria - [ ] Both sidecars + shortcodes ship; `card` never appears in picker or tree - [ ] Parent form edits cards as collection rows: add, drag-reorder, collapse, per-row summary shows heading - [ ] Card with link renders one wrapping anchor (no nested interactive elements); without link, no anchor - [ ] Grid is responsive: `cols` is a max, collapsing on narrow viewports like the image grid - [ ] Publish succeeds via real Hugo build with 0, 1, and many cards ## Blocked by None - can start immediately
Author
Owner

This was generated by AI during triage.

Triage confirmed — enhancement, ready-for-agent. The issue body is the authoritative agent brief.

Verified against the codebase: the items-collection pattern this copies is fully established by image.yaml/img.yaml (hidden child, summary:, IRRE-style rows, paired open/close tags), and the link param type with its linkTarget companion exists on img. The proposed sidecars are schema-valid as written.

> *This was generated by AI during triage.* **Triage confirmed — enhancement, ready-for-agent.** The issue body is the authoritative agent brief. Verified against the codebase: the items-collection pattern this copies is fully established by `image.yaml`/`img.yaml` (hidden child, `summary:`, IRRE-style rows, paired open/close tags), and the `link` param type with its `linkTarget` companion exists on `img`. The proposed sidecars are schema-valid as written.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle#92
No description provided.