GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
372 stars 171 forks source link

Provide text_format render element for string schema properties #4132

Open stefan-korn opened 8 months ago

stefan-korn commented 8 months ago

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

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.

dafeder commented 6 months ago

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