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

No images shown in full record display by default #2992

Open
mephillips-durham opened this issue Nov 21, 2023 · 1 comment
Open

No images shown in full record display by default #2992

mephillips-durham opened this issue Nov 21, 2023 · 1 comment

Comments

@mephillips-durham
Copy link
Contributor

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 <iframe> or tag to make the image appear.

By contrast, if we look at the templates used in the Edit view of the record, we get these:

/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/bundler/gems/spotlight-0f5a47eefe43/app/views/spotlight/catalog/edit.html.erb
/home/vagrant/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/blacklight-7.34.0/app/views/catalog/_show_header.html.erb
app/views/catalog/_openseadragon_default.html.erb

and others which follow to make the form elements appear. The _openseadragon_default.html.erb template makes the IIIF viewer appear.

On our previous attempt to implement Spotlight, in August 2021, we had replaced this with Mirador, and that was good for both the editing view and the full record view. Repeating that modification with the latest Spotlight and Blacklight now only affects the editing view, and the full record display has no image viewer, neither Mirador nor OpenSeadragon.

@SunnyMoonSchott
Copy link

SunnyMoonSchott commented Mar 15, 2024

The following is a reproduction of this issue using a Stanford IIIF manifest.

As you can see, the preview images are not rendered in the items tab:

image

Not rendered in the individual item view:

Screenshot from 2024-03-15 15-02-36

Or in the item edit view:

Screenshot from 2024-03-15 15-08-16

The pictures are viewable as thumbnails when creating a static slideshow:

Screenshot from 2024-03-15 15-12-58

And are displayed properly in the Feature Page when displayed as a static slideshow:

Screenshot from 2024-03-15 15-21-43

However, when displayed in a viewer window, the image is not correctly rendered:

Screenshot from 2024-03-15 15-23-28

Inspecting the elements shows that the viewer is not rendered at all:

Screenshot from 2024-03-15 15-24-58

This spotlight instance was instantiated on an ubuntu vagrant box using the following script:


echo "Start of bundle-install.sh"

# Spotlight
cd
if [ ! -e dur-spotlight/app ]; then
    echo "Spotlight bundle install"

    # Need these lines for initial provisioning, as parent environment has not yet had these executed
    source $HOME/.asdf/asdf.sh
    source $HOME/.asdf/completions/asdf.bash

    # Create new Spotlight application
    SKIP_TRANSLATION=1 rails new dur-spotlight --quiet -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb
    cd dur-spotlight
    SKIP_TRANSLATION=1 rake db:migrate

    # Make corrections to generated manifest.js
    cd
    sed -i 's/js\/\//js\n\/\//' dur-spotlight/app/assets/config/manifest.js
    sed -i 's/^\/\/= link application.js$//' dur-spotlight/app/assets/config/manifest.js
    
    cd
    cat <<EOF >> dur-spotlight/.solr_wrapper.yml
  # Added by bundle-install.sh to persist data
  persist: true
# Added by bundle-install.sh to avoid data being kept in /tmp
download_dir: /home/vagrant/tmp
instance_dir: /home/vagrant/solr_data
# Added by bundle-install.sh to listen on all addresses
env:
  SOLR_JETTY_HOST: 0.0.0.0
EOF
fi

echo "End of bundle-install.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants