projectblacklight / spotlight

Spotlight enables librarians, curators, and others who are responsible for digital collections to create attractive, feature-rich websites that highlight these collections.
Other
161 stars 65 forks source link

No images shown in full record display by default #2992

Closed mephillips-durham closed 3 months ago

mephillips-durham commented 1 year ago

In a freshly-bootstrapped rails application based on the Spotlight engine, any images, whether static or IIIF, are only shown in the brief results screens and do not appear in the full record display. This is not helpful to new users, who may struggle to work out how to add the images. Most users will want images displayed on the full record view.

By contrast, when you Edit a record, clicking the Edit button from the full record display, the images are shown. It appears this is because the edit screens use an older mechanism. I wonder whether the images disappeared from the default full record display when Blacklight moved to using View Controllers?

I don't know whether there is a very simple fix that I have not found, and I don't know whether it needs addressing in Spotlight or in Blacklight.

Background investigations

If I turn on diagnostics in the rendering so that the HTML is marked up with the template filenames using

config.action_view.annotate_rendered_view_with_filenames = true

then in the normal full record display we have these templates in use:

/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/blacklight-7.34.0/app/components/blacklight/document_component.rb
/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/blacklight-7.34.0/app/components/blacklight/document_metadata_component.rb
/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/blacklight-7.34.0/app/components/blacklight/metadata_field_component.rb

The metadata_field_component would be repeated for each metadata field in the record, displaying each in a new row with the field name on the left. I would expect the document_component.rb to generate or include something to make the image appear. It does make a couple of lines appear with "og" metadata for use by Facebook etc.:

<meta property="og:title" content="Example title here" />
<meta property="og:og:image" content="/images/535-8c9b943d3fccdc21ebd2930481a0f3c6/full/!400,400/0/default.jpg" />

But there is no