esmero / format_strawberryfield

Set of Display formatters, extractors and utils to make Strawberry field data glow
GNU Lesser General Public License v3.0
6 stars 9 forks source link

Trigger View Mode Selection based on ADO type for canonical Node URIs #33

Open DiegoPino opened 4 years ago

DiegoPino commented 4 years ago

What is the problem?

Right now we allow users to select, manually, which of the many View Modes they want to use on an ADO (Archipelago Digital Object)/Node display page (the canonical URL). This has some benefits because it allows people to choose "wisely" and customize per ADO which on will be used. Some use cases also support that, since some schema.org types like "Book" could eventually be shown as a mix of audio and a PDF? and not only via the View Mode that provides the IA Book reader. But even so, it speaks against other uses cases, simpler ones, like a User Role that has / does not need to make that decision and does not even Know what each View Mode entails.

The Solution

Build a simple config option that allows a Mapping between existing (Solr indexed) JSON Types values and defined in Drupal View Modes. This mappings will only kick in if during ingest/edit a Node was published using the Default View Mode (which implies also the default behaviours). And that also means, a power user can always override these mappings.

DiegoPino commented 4 years ago

Resolved via https://github.com/esmero/format_strawberryfield/commit/4bf717c9a10a5cc624a13d8fee4356cefd76f713 Thanks @giancarlobi for testing!

DiegoPino commented 4 years ago

I was aware of some UI inconsistency on having the add button on the bottom of the form on not grouped with the ADO and View Mode selection. I got feedback on Friday on this so decide to fix it. Reopening now.