Skip to content

Add FormatBased cover provider - #5613

Open
stweil wants to merge 1 commit into
vufind-org:devfrom
stweil:formatbased-covers
Open

Add FormatBased cover provider#5613
stweil wants to merge 1 commit into
vufind-org:devfrom
stweil:formatbased-covers

Conversation

@stweil

@stweil stweil commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Add a cover content loader that provides a cover image depending on the format of a record (Solr field "format") if none of the other cover providers found one. It is meant to be used as the last entry of the coverimages list in the [Content] section of config.ini.

Images are looked up in a configurable directory (image_dir in the new [FormatBasedCovers] section, defaulting to
themes/bootstrap5/images/format-covers, which ships a set of simple SVG cover images for the following record formats:

Article, Book, Book Chapter, Braille, Conference Proceeding,
Database, Dissertation, Electronic, eBook, Globe, Government
Document, Journal, Kit, Map, Microfilm, Musical Score, Newspaper,
Photo, Physical Object, Serial, Software, Sound Recording, Text,
Thesis and Video.

Records with any other format (or no format at all) fall back to a generic default image. Explicit per-format mappings and the default image can be configured as well; image paths may be filesystem paths or file:// or http(s) URLs.

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)

Add a cover content loader that provides a cover image depending on
the format of a record (Solr field "format") if none of the other
cover providers found one. It is meant to be used as the last entry
of the coverimages list in the [Content] section of config.ini.

Images are looked up in a configurable directory (image_dir in the
new [FormatBasedCovers] section, defaulting to
themes/bootstrap5/images/format-covers, which ships a set of simple
SVG cover images for the following record formats:

  Article, Book, Book Chapter, Braille, Conference Proceeding,
  Database, Dissertation, Electronic, eBook, Globe, Government
  Document, Journal, Kit, Map, Microfilm, Musical Score, Newspaper,
  Photo, Physical Object, Serial, Software, Sound Recording, Text,
  Thesis and Video.

Records with any other format (or no format at all) fall back to a
generic default image. Explicit per-format mappings and the default
image can be configured as well; image paths may be filesystem paths
or file:// or http(s) URLs.

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil

stweil commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

All cover images in this PR were created by AI (qwen3.8-27b).

My test installation uses this code.

Stabicat and maybe other VuFind installations also have format based cover images, but I don't know their source code.

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

Successfully merging this pull request may close these issues.

1 participant