<div dir="ltr">Hi David,<div><br></div><div>I'm very jealous; that's exactly what I'm going for, even the clickable "et al" (I thought I might have had an original idea up until I saw that).</div><div><br></div><div>Any guidance you can give me would be brilliant. I may hold off jumping in and editing that file for the time being and do some more investigating.</div><div><br></div><div>Thanks,</div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 19, 2018 at 9:58 AM David R Newman <<a href="mailto:drn@ecs.soton.ac.uk">drn@ecs.soton.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi James,<br>
<br>
This is what I did for one of the repository I help maintain: <br>
<br>
<a href="http://researchonline.ljmu.ac.uk/7570/" rel="noreferrer" target="_blank">http://researchonline.ljmu.ac.uk/7570/</a><br>
<br>
I should be able to share the code if I can extract it from the rest of<br>
the codebase, as it requires edits to 3-4 files, if I remember<br>
correctly. Also, if you have other features like people_with_orcids<br>
that modifies the list of authors in the citation in some way (i.e. in<br>
this case add little ORCID buttons to click), then it may require a bit<br>
more of an effort to merge.<br>
<br>
Regards<br>
<br>
David Newman<br>
<br>
On Wed, 2018-09-19 at 09:36 +0100, James Kerwin via Eprints-tech wrote:<br>
> Hi All,<br>
> <br>
> I have been tasked with limiting the number of authors that display<br>
> in any given EPrint Abstract page as when there are many<br>
> authors/creators associated with an EPrint it ruins the abstract<br>
> page.<br>
> <br>
> I have edited default.xml in citations and can make it show ten<br>
> authors and add an "et al" to the end if there are more than ten<br>
> authors. <br>
> <br>
> However, previously the creators/authors list was generated via:<br>
> <br>
> <print expr="people_with_orcids(creators)" /><br>
> <br>
> I wasn't able to iterate through this so I instead used:<br>
> <br>
> <epc:foreach expr="creators_name" iterator="name" limit="10"><br>
> <print expr="$name" /><br>
> <br>
> If I wanted to change the behaviour of "people_with_orcids(creators)<br>
> how would I do this? I don't need detailed instruction, just a nudge<br>
> towards which file(s) control this if anybody knows.<br>
> <br>
> My suspicion is that I need to change the sub<br>
> "run_people_with_orcids" in a file named <a href="http://z_orcid_support.pl" rel="noreferrer" target="_blank">z_orcid_support.pl</a> in<br>
> ../[Archive_Id]/cfg/cfg.d, but I'm not super excited about chopping<br>
> and changing things without fully knowing if I should (sub snippet<br>
> below).<br>
> <br>
> Thanks,<br>
> James<br>
> <br>
> #Rendering ORCIDs<br>
> {<br>
> package EPrints::Script::Compiled;<br>
> use strict;<br>
> <br>
> sub run_people_with_orcids<br>
> {<br>
> my( $self, $state, $value ) = @_;<br>
> <br>
> my $session = $state->{session};<br>
> my $r = $state->{session}->make_doc_fragment;<br>
> <br>
> my $creators = $value->[0];<br>
> <br>
> foreach my $i (0..$#$creators)<br>
> {<br>
> <br>
> my $creator = @$creators[$i];<br>
> <br>
> if( $i > 0 )<br>
> {<br>
> #not first item (or only one item)<br>
> if( $i == $#$creators )<br>
> {<br>
> #last item<br>
> $r->appendChild( $session->make_text( "<br>
> and " ) );<br>
> }<br>
> else<br>
> {<br>
> $r->appendChild( $session->make_text(<br>
> ", " ) );<br>
> }<br>
> }<br>
> <br>
> *** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-</a><br>
> tech<br>
> *** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
> *** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
> *** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
</blockquote></div>