EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09828


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Conditional EPrints Field Names based on Eprint Type


CAUTION: This e-mail originated outside the University of Southampton.

https://github.com/eprints/eprints3.4/blob/master/lib/lang/en/phrases/system.xml

Abstract is a phrase, so I think you can use epc:if on it. But you need to pin the eprints type somewhere... I cannot find examples online, maybe epc:if is not supported in phrases? Anyway, you can use epc:pin to set the value instead of a static translation. This should the reference:

https://wiki.eprints.org/w/EPrints_Control_Format#epc:phrase

Il 23/08/24 08:37, James Kerwin ha scritto:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
Hi All,

We're sprucing up the repository, which is awful news for me.

I need to alter how certain field names are rendered, depending on the EPrint type.

For example, if an item is an Article type I want the abstract to continue to be rendered as "Abstract". For report I want the Abstract to be rendered as "Executive Summary". That sort of thing. I can do this easily enough using epc:if in the summary_page.xml citation, but I want the field names to be consistent in the Details screen where my team log in.

Ideally I would do something in cfg.d, but I think it's going to be more involved than that. I'm aware I could simply conditionally map this in the crosswalks, but I'm trying to limit the number of new fields I create because we already have a lot.

Is there a way I should go about this? Looking at Details.pm I can see a "render_name" sub being called. I THINK the version of this I need to alter might be in MetaField.pm, but I'm really not sure.

Does anyone know if this would be possible and where I should start with it? I'm not looking for a fully flushed out solution, just some direction.

Thanks,
James

*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/