Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize nested component structures with data #105

Open
bglw opened this issue Apr 12, 2022 · 0 comments
Open

Initialize nested component structures with data #105

bglw opened this issue Apr 12, 2022 · 0 comments
Labels
cms structures Related to the generation of structures for hydrating the CMS enhancement New feature or request

Comments

@bglw
Copy link
Contributor

bglw commented Apr 12, 2022

Currently, the only component shorthand available is:

button: "bookshop:button" #or:
buttons: ["bookshop:button"]

In both of these instances, the object or array will be initialized in the CMS empty. We should provide something like the following:

button: "bookshop:button!" #or:
buttons: ["bookshop:button!", "bookshop:button!"]

Where components suffixed with ! are pre-populated when added to the CMS.

Bonus considerations:

  • If the core CMS adds a non-nullable object structure type, how would that be represented here?
  • If a user tries bookshop:structure:content_blocks!, how should that behave, and what could be implemented to achieve this?
    • A structure key could be supplied? (bookshop:structure:content_blocks:title!)
  • Alternative syntaxes:
    • Five buttons: bookshop:button(5)
    • A content_blocks array with starter components added: bookshop:structure:content_blocks(title,paragraph,button)
@bglw bglw added enhancement New feature or request cms structures Related to the generation of structures for hydrating the CMS labels Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cms structures Related to the generation of structures for hydrating the CMS enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant