Jump to content

Pagerange field

From EPrints Documentation
Revision as of 22:52, 9 April 2023 by Drn@ecs.soton.ac.uk (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Description[edit]

This field is stored as a single text string in the database but is presented as two text fields to fill in a from and a to. The text between the two fields is set using the lib/metafield:to phrase.

When the two fields are saved to the database a - is added between the from and a to fields so 5 and 10 becomes 5-10. This would then be rendered in a citation using lib/metafield/pagerange:range, by default pp. 5-10. If only the from field is entered or is the same as the to field then the citation would be rendered using lib/metafield/pagerange:from_page or lib/metafield/pagerange:same_page respectively. By default: p. 5, if from field is 5.

Inheritance[edit]

Additional Properties[edit]

As for Int fields.

Required Phrases[edit]

No additional phrases beyond those required for Int fields.

Database[edit]

Pagerange fields are stored in the database as

fieldname VARCHAR(255)

API[edit]

See API page.

Examples[edit]

Most basic example.

{
    name => 'pagerange',
    type => 'pagerange',
}