EPrints Technical Mailing List Archive
Message: #07487
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] EPScript - Author Limit
- To: <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] EPScript - Author Limit
- From: James Kerwin <jkerwin2101@gmail.com>
- Date: Wed, 19 Sep 2018 09:36:12 +0100
Hi All,
I have been tasked with limiting the number of authors that display in any given EPrint Abstract page as when there are many authors/creators associated with an EPrint it ruins the abstract page.
I have edited default.xml in citations and can make it show ten authors and add an "et al" to the end if there are more than ten authors.
However, previously the creators/authors list was generated via:
<print expr="people_with_orcids(creators)" />
I wasn't able to iterate through this so I instead used:
<epc:foreach expr="creators_name" iterator="name" limit="10">
<print expr="$name" />
If I wanted to change the behaviour of "people_with_orcids(creators) how would I do this? I don't need detailed instruction, just a nudge towards which file(s) control this if anybody knows.
My suspicion is that I need to change the sub "run_people_with_orcids" in a file named z_orcid_support.pl in ../[Archive_Id]/cfg/cfg.d, but I'm not super excited about chopping and changing things without fully knowing if I should (sub snippet below).
Thanks,
James
#Rendering ORCIDs
{
package EPrints::Script::Compiled;
use strict;
sub run_people_with_orcids
{
my( $self, $state, $value ) = @_;
my $session = $state->{session};
my $r = $state->{session}->make_doc_fragment;
my $creators = $value->[0];
foreach my $i (0..$#$creators)
{
my $creator = @$creators[$i];
if( $i > 0 )
{
#not first item (or only one item)
if( $i == $#$creators )
{
#last item
$r->appendChild( $session->make_text( " and " ) );
}
else
{
$r->appendChild( $session->make_text( ", " ) );
}
}
- Follow-Ups:
- [EP-tech] EPScript - Author Limit
- From: James Kerwin <jkerwin2101@gmail.com>
- [EP-tech] EPScript - Author Limit
- References:
- [EP-tech] EPScript - Author Limit
- From: James Kerwin <jkerwin2101@gmail.com>
- [EP-tech] EPScript - Author Limit
- Prev by Date: [EP-tech] Moving Things Around (ep_summary_content_left etc.)
- Next by Date: Re: [EP-tech] EPScript - Author Limit
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):