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

Choose a specific type icon when there are multiple resource types #1398

Open
thatbudakguy opened this issue Sep 11, 2024 · 1 comment
Open
Assignees

Comments

@thatbudakguy
Copy link
Member

thatbudakguy commented Sep 11, 2024

Both of these items are rasters:

https://earthworks.stanford.edu/catalog/stanford-zh312vg7278
https://earthworks.stanford.edu/catalog/stanford-nz275ty2290

However, only zh312vg7278 displays "raster" as its type in the header icons area – nz275ty2290 shows "dataset". The more specific value ("raster") is preferable here.

I think this is because zh312vg7278 has only a single resource type ("Raster data") and nz275ty2290 has both "Raster data" and "Nautical charts". This confuses our logic that tries to pick an icon from the resource types, because there are two to choose from.

I think the right logic looks like this:

  1. If the record has a resource class of "Datasets"
    a. If the record has a resource type in the OGM community list vocabulary, use that resource type as the icon
    b. Otherwise, use "Datasets" as the icon
  2. Otherwise, use the default behavior of geoblacklight_icon

Keeping in mind that resource type is a controlled vocabulary with two separate valid lists of vocab – the LOC values, which are more applicable to maps and won't translate to an icon, and the OGM community values, which are more applicable to geospatial data (including rasters) and will usually map to a particular icon.

For nz275ty2290, "Raster data" comes from the OGM list, but "Nautical charts" comes from the LOC list.

In the (very unlikely and maybe impossible?) event that there are two or more values in resource type from the OGM list, I think it's perfectly acceptable to just pick one, regardless of order.

@thatbudakguy
Copy link
Member Author

Handled upstream by geoblacklight/geoblacklight@73ef317

thatbudakguy added a commit to geoblacklight/geoblacklight that referenced this issue Sep 16, 2024
thatbudakguy added a commit to geoblacklight/geoblacklight that referenced this issue Sep 16, 2024
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

1 participant