Allow TOC levels with custom display labels

Description

Currently, a TOC level (in toc-layouts.xml) defines a field (level/@field) that is used to create a SOLR search facet. The facet information in the SOLR response is then used to render the corresponding TOC level in HTML.

  • While doing so, the corresponding value of the search facet is used as a display label for the TOC item.

  • Also, all entries at the same level are ordered (by SOLR) using this value.

This is okay for fields with a natural order (e.g. mods.yearIssued). But there are scenarios where this is not the case, say if a publication has many children and a section level should be used to organize the children (e.g. my.toc.section.number with values 1, 2, ... for sorting and my.toc.section with values Foo, Bar, ... as display values). Example:

A corresponding TOC layout might be:

<toc-layout id="publication-sections" field="mir.toc.ancestor"> <label>Modell 0, Ebene 1: Publikation (mit Sektionen)</label> <level field="my.toc.section.number" displayField="my.toc.section" order="asc" expanded="first"> <publications> <sortBy field="mir.toc.host.page.int" order="asc" /> <sortBy field="mir.toc.host.page.str" order="asc" /> </publications> </level> </toc-layout>

Environment

None

Attachments

1

Activity

Torsten Krause 
April 25, 2023 at 12:51 PM

I’d be happy to expand the documentation for the TOC mechanism, but I don’t think it exists yet (and I’m unwilling to create it as part of this ticket).

Torsten Krause 
April 25, 2023 at 12:49 PM

No, the SOLR-fields my.toc.section.number and my.toc.section , the way the these fields are populated and the corresponding TOC layout are just an example. This ticket just adds the displayField-attribute to the set of possible attributes, which then may be used with any SOLR field (standard or custom).

Kathleen Neumann 
April 25, 2023 at 12:10 PM

Can we add a short documentation here?
If I see it right, we need to add mir.toc.section and mir.toc.section.number as searchfield in my solr schema and config, right? And the above mentioned xml in my toc-layouts.xml

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created March 6, 2023 at 10:23 AM
Updated July 14, 2023 at 10:09 AM
Resolved July 14, 2023 at 9:44 AM

Flag notifications