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

Provide text_format render element for string schema properties #4132

Open
stefan-korn opened this issue Feb 22, 2024 · 1 comment · May be fixed by #4133
Open

Provide text_format render element for string schema properties #4132

stefan-korn opened this issue Feb 22, 2024 · 1 comment · May be fixed by #4133

Comments

@stefan-korn
Copy link
Contributor

User Story

Editors want to use text_format render elements for long text fields (currently designated via textarea widget in schema.ui.json), for example to edit long text in CKEditor.

Acceptance Criteria

  • provide option "text_format" in schema.ui.json to indicate the text_format which should be used for the long text property.
  • show "text_format" editing in JSON form widget with the indicated format.

Caveats

It is not (easily) possible to store the format together with the string in json. Therefore I would propose to not store the format in the JSON and keep this fixed in the schema.ui.json. So it will be allowed only one format (via allowed_formats) in the text format widget and no changing is possible via UI.
The output of the string needs to be taken care independently. For example currently the node--data template escapes any HTML in the string (though I suppose it is not even necessary here, because Twig does escaping itself).
If you want to output HTML in the description you need to change this and take care yourself. You also need to ensure that only the HTML you want is output, so maybe custom processing is needed (but this is done anyway via metastore_preprocess_node__data), so you can do it like there for yourself.

stefan-korn added a commit to stefan-korn/dkan that referenced this issue Feb 22, 2024
@stefan-korn stefan-korn linked a pull request Feb 22, 2024 that will close this issue
3 tasks
stefan-korn added a commit to stefan-korn/dkan that referenced this issue Feb 22, 2024
@dafeder
Copy link
Member

dafeder commented Apr 5, 2024

Hi Stefan - I like this concept. Flagging @dgading.

@dafeder dafeder self-assigned this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants