Skip to content

process articles with multiple imprints in preview#638

Open
SteffenAstheimer wants to merge 9 commits intodevelopfrom
display-multiple-imprints-in-articles
Open

process articles with multiple imprints in preview#638
SteffenAstheimer wants to merge 9 commits intodevelopfrom
display-multiple-imprints-in-articles

Conversation

@SteffenAstheimer
Copy link
Copy Markdown
Contributor

This will handle articles with multiple imprints, omit the journal title from the citation and add a list of all journal and issues in which the text was published.

Here an example:
image

And one example where we even have links to the texts and might think about adding the links to the actual issue titles in the future:
image

@SteffenAstheimer SteffenAstheimer added this to the Release 4.14 milestone Apr 16, 2026
@SteffenAstheimer SteffenAstheimer self-assigned this Apr 16, 2026
@SteffenAstheimer SteffenAstheimer added enhancement docType:biblio bugs and features related to the display of biblio entries labels Apr 16, 2026
@SteffenAstheimer SteffenAstheimer linked an issue Apr 16, 2026 that may be closed by this pull request
Comment thread testing/xqsuite/biblio-tests.xqm Outdated
Comment thread templates/includes/preview-biblio.html Outdated
Comment thread modules/bibl.xqm Outdated
Comment thread modules/bibl.xqm Outdated
declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrapperElement as element(), $lang as xs:string) as element()? {
if (count($monogr/tei:imprint) = 1) then
bibl:print-journal-citation-from-imprint($monogr, $monogr/tei:imprint, $wrapperElement, $lang)
else ()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether this is really what we want since this will only work for journal citations (in general) when used with the preview-biblio.html where the missing imprints are output.
All other calls to this function (e.g. from letter editorials) will have empty imprints.
I know this is tricky to solve, I just wanted to make sure about the consequences …

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's definitely a catch. I guess so far it works, since we only have multiple imprints in our bibliography data, and nowhere else. But in theory it should be allowed elsewhere.

We could call the new helper function bibl:printJournalCitationsByImprint from within document.html where the sources are created. This is the only other place where we might want to display multiple imprints that I can think of (apart from the not yet existing single view html page):

<div data-template="app:textSources">
<h3 class="media-heading">
<span data-template="lang:translate">tradition</span>
<em class="small" data-template="app-shared:print" data-template-key="textSourcesCountString"/>
</h3>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this:

  1. We return to having one bibl:printJournalCitation() function which handles all occurrences of journal citations, both with single or multiple imprints. Handling multiple imprints should be seen as fallback behaviour. All imprints simply get concatenated and the whole journal citation is classified with a "deleteme" class (for step 2):

declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrapperElement as element(), $lang as xs:string) as element()? {
let $journalTitle :=
if (count($monogr/tei:imprint) gt 1)
then <xhtml:span class="deleteme_journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>
else (<xhtml:span class="journalTitle">{bibl:printTitles($monogr/tei:title, $monogr/tei:edition)/node()}</xhtml:span>)
let $biblScope :=
if (count($monogr/tei:imprint) gt 1)
then for $imprint in $monogr/tei:imprint
return <xhtml:span class="deleteme_imprintSection">{bibl:biblScope($imprint, $lang)}</xhtml:span>
else <xhtml:span class="imprint">{bibl:biblScope($monogr/tei:imprint, $lang)}</xhtml:span>
return
element {$wrapperElement/name()} {
$wrapperElement/@*,
$journalTitle,
$biblScope
}
};

  1. In app:preview-citation() we erase all deleteme attributes to prevent both journal title and issues to appear in the citation string:

WeGA-WebApp/modules/app.xqm

Lines 1977 to 1989 in c77eea0

declare
%templates:default("lang", "en")
function app:preview-citation($node as node(), $model as map(*), $lang as xs:string) as element(xhtml:p)? {
let $source := query:get-main-source($model('doc'))
return
typeswitch($source)
case element(tei:biblStruct) return
element {node-name($node)} {
$node/@*,
bibl:printCitation($source, <xhtml:p/>, $lang)/node()[not(self::xhtml:span[@class=('deleteme_journalTitle', 'deleteme_imprintSection')])]
}
default return ()
};

  1. We use the bug of leftover "in: " strings as a feature and print all issues of the serial publication as list items without the leading "erschienen in: " header:
image

Alternatively we could surely get rid of the "in: " and return to having a section header "erschienen in: ".

What do you think, @peterstadler?

Comment thread templates/includes/preview-biblio.html Outdated
Comment thread modules/app.xqm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docType:biblio bugs and features related to the display of biblio entries enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

display multiple imprints in articles

2 participants