EPrints Technical Mailing List Archive

Message: #07732


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

Re: [EP-tech] Abstract Metadata Rendering/EPC


Morning All,

In case anybody else faces the same challenge, I managed to do this eventually. I'm not certain it's the best way, but it does work well so far.

 My task was to change the creators field in the EPrint metadata from:
screen_before.png

To (or something similar):
screen_after.png

I had a few false starts looking at altering (in my cfg.d!) EPrints::Repository::render_name and in EPrints::MetaField::Name::render_single_value as well as Compile.pm. I took some inspiration from z_orcid_support.pl. I copied and altered this (z_render_citation_name.pl) and then in summary_page.xml (recollect_summary_page.xml in this case) called my new function:

Where I previously had:

<epc:print expr="$item.property($fieldname)" />

I now have:

<epc:if test="$fieldname != 'creators_name'">
    <epc:print expr="$item.property($fieldname)" />
</epc:if>

<epc:if test="$fieldname = 'creators_name'">
    <print expr="citation_namesmeta(creators, eprintid)" />
</epc:if>

In my new function I can pretty much alter the display to be anything I like, which is helpful! I can't say if this is the ideal approach, but it suits my needs.

Thanks,
James




On Tue, Mar 12, 2019 at 9:51 AM James Kerwin via Eprints-tech <eprints-tech@ecs.soton.ac.uk> wrote:
Hi All,

I'm back on the "Hedonic Treadmill" of EPrints and need some advice.

I can't work out how the metadata in an EPrint abstract is rendered, which I need to know in order to change how names of authors/creators are shown. At the moment they are listed side by side, separated by commas. There are too many commas and it's difficult to read.

Could anybody point me in the right direction? I'm with it as far as:

<epc:print expr="$item.property($fieldname)" />

in my "summary_page.xml" file. The "name" field in question is a compound field called "creators" ("name" and "id") and in the summary_page_metadata config I've passed the name as "creators_name" so as to not display the related "id" on the abstract pages.

I spent hours trying to work this out yesterday and didn't get far.

Thanks,
James
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/