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

Map/Dictionary Widget #5489

Open
bmackinney opened this issue Jun 8, 2021 · 5 comments
Open

Map/Dictionary Widget #5489

bmackinney opened this issue Jun 8, 2021 · 5 comments
Labels
area: extensions/widgets/list good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@bmackinney
Copy link
Contributor

https://answers.netlify.com/t/map-dictionary-fields/5241 has problem faced and solution found.

I'm making a files collection for hugo configuration files, and to edit the taxonomies field requires users to be able to define keys and values, resulting in something like:

[taxonomies]
featured = "featured"
topic = "topics"
tag = "tags"
team = "team"

I originally thought the code widget would work, but it outputs only strings.

@bmackinney bmackinney added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jun 8, 2021
@erezrokah
Copy link
Contributor

Hi @bmackinney, thanks for sharing your use case. It does seem useful to have a dictionary widget.
We would happily accept a PR for it, if someone is up for it.

@bmackinney
Copy link
Contributor Author

@erezrokah I'm up for it - it also looks like much of the work has already been done, by Pablo. My approach to this PR would be to:

Am I missing anything?

@erezrokah
Copy link
Contributor

Hi @bmackinney, thanks for looking into this. You approach seems 💯

However, I think might be better to clone an existing widget package instead of following this guide, as we already have the build step configured, etc.

Other than that, maybe adding some tests for the new widget?

@bmackinney
Copy link
Contributor Author

@erezrokah is it possible for the code widget to output raw code instead of a string? I think it would be a simpler solution that will satisfy more of my needs.

@erezrokah
Copy link
Contributor

@erezrokah is it possible for the code widget to output raw code instead of a string? I think it would be a simpler solution that will satisfy more of my needs.

Not at the moment. Widget values are always coupled to a field name (no top level values).
Also we'd have to consider that raw code can break yaml/markdown syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/widgets/list good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

2 participants