ckanext-scheming icon indicating copy to clipboard operation
ckanext-scheming copied to clipboard

Resource-level context-sensitive schemas

Open jqnatividad opened this issue 7 years ago • 3 comments

Is there a way to implement context-sensitive resource fields - e.g. a user selects CSV format for a resource, and it has certain resource fields, which is different if a user selects PDF format?

jqnatividad avatar Sep 12 '18 17:09 jqnatividad

I think the best way to do that is by adding a JS resource to the resource form and use it to clear and hide other specific fields based on the format value.

wardi avatar Sep 12 '18 17:09 wardi

Thanks @wardi for the quick feedback. Any plans on implementing a resource_type key (similar to dataset_type) to scheming with the supporting JS logic?

jqnatividad avatar Sep 12 '18 18:09 jqnatividad

no but it could be done in a separate plugin. The trouble with putting it into scheming is it's hard to know how to clear custom form fields, but the benefit is we could define some standard hooks that people extending scheming could use.

wardi avatar Sep 12 '18 18:09 wardi