Skip to content

EDS: Get the item's page count - #5523

Open
maccabeelevine wants to merge 6 commits into
vufind-org:devfrom
maccabeelevine:eds-page-count
Open

EDS: Get the item's page count#5523
maccabeelevine wants to merge 6 commits into
vufind-org:devfrom
maccabeelevine:eds-page-count

Conversation

@maccabeelevine

Copy link
Copy Markdown
Member

The page count is sometimes part of the src item data, i.e. the last element of

Source: Marvels & Tales; 2026, Vol. 40 Issue 1, p47-64, 18p

But in some dense contexts like the combined search, you may just want to display the page count.


/**
* Get year of containing record.
* Get the start page of the item that contains this record.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unrelated, just a fix.

'BibRecord/BibEntity/PhysicalDescription/Pagination/PageCount'
)[0] ?? null) {
return $pageCount;
} elseif ($pageCount = $this->getItem('Name', 'Pages')) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As usual the API repsonses are a bit of a mystery, so I don't know why the page count sometimes comes in via the BibRecord.../Pagination section like start page, and why it's sometimes in the Items data. I assume the answer is "vendor data 🤷 " but @cwolfebsco can you shed any light?

Unfortunately because our EDS templates will display any data that comes from Items, this means that record pages will sometimes display page count and sometimes won't, depending on which field has it. I have a set of configs in my RecordDataFormatter/EDS.ini to hide it from Items and display it via this new method. I don't know if it's generalizable enough to upstream though, even commented out.

[Defaults]
core[] = 'Page Count'
result-list[] = 'Page Count'

[Field_Page Count]
dataMethod = 'getPageCount'
# No thought yet into this positioning
pos = 300

[CoreItems]
...
extraLineOptions[] = 'CorePageCount'

; Need to disable Page Count here from EDS [Items] block
; because we need to load it with getPageCount (above) to cover
; both ways the field can show up from the API.
[CorePageCount]
lineIdentifierKey = 'Name'
lineIdentifierValue = 'Pages'
enabled = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@maccabeelevine "vendor data" sounds about right, I am afraid :( Our teams try to match the available data the best they can. While a great benefit to have the original record searched, this is one of the unfortunate side effect.

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.

2 participants