Difference between revisions of "Limiting names shown"

From EPrints Documentation
Jump to: navigation, search
m (link to github's commit added)
(Added limiting names page from serviceswiki)
Line 1: Line 1:
=== To Be Written ===
+
Although all names should be shown for exports, sometimes an EPrint has so many creators or editors it is really not useful to display then all without user prompting.  Therefore, I have written a render function (in '''site_lib/cfg.d/limit_names_shown.pl''') to allow some names to be hidden and then displayed when a link on "et al" is clicked. Below describes how you can make good use of the render function:
This page will contain information on how citations can be made to limit the number of authors shown but be expandable with a single click.
 
  
In the meantime look at [https://github.com/eprints/eprints3.4/commit/10b90d2a1cb3ede4ae6dc1dc62d9f6524c1b626a commit@github]
+
1. Make sure that '''site_lib''' is update to date with SVN.
 +
 
 +
 
 +
2. Edit your archive's '''cfg/cfg.d/eprint_fields.pl''' and create a virtual field replica of the name field on which you want to be able to limit authors.  The example bellow will limit the number of creators display to 10 before showing an "et al" so you can display the rest.
 +
{
 +
        name => 'creators_name_limited',
 +
        type => 'name',
 +
        virtual => 1,
 +
        render_value => 'limit_names_shown',
 +
        render_limit => 10,
 +
},
 +
 
 +
 
 +
 
 +
3. Copy your archives '''cfg/citations/eprint/default.xml''' to '''cfg/citations/eprint/display.xml'''.
 +
 
 +
 
 +
4. Edit display.xml adding '''_limited''' to all the name fields you want to limit the number of names initially displayed.
 +
 
 +
 
 +
5. Edit '''cfg/citations/eprint/summary_page.xml''' and '''cfg/citations/eprint/result.xml''' replace '''item.citation('default')''' with '''item.citation('display')'''.  (N.B. you may need to modify other citation styles if they have been created for your archive).
 +
 
 +
 
 +
6. Reload webserver or reload configuration through the '''Admin''' page's '''Config. Tools''' tab.

Revision as of 19:28, 25 August 2021

Although all names should be shown for exports, sometimes an EPrint has so many creators or editors it is really not useful to display then all without user prompting. Therefore, I have written a render function (in site_lib/cfg.d/limit_names_shown.pl) to allow some names to be hidden and then displayed when a link on "et al" is clicked. Below describes how you can make good use of the render function:

1. Make sure that site_lib is update to date with SVN.


2. Edit your archive's cfg/cfg.d/eprint_fields.pl and create a virtual field replica of the name field on which you want to be able to limit authors. The example bellow will limit the number of creators display to 10 before showing an "et al" so you can display the rest.

{
        name => 'creators_name_limited',
        type => 'name',
        virtual => 1,
        render_value => 'limit_names_shown',
        render_limit => 10,
},


3. Copy your archives cfg/citations/eprint/default.xml to cfg/citations/eprint/display.xml.


4. Edit display.xml adding _limited to all the name fields you want to limit the number of names initially displayed.


5. Edit cfg/citations/eprint/summary_page.xml and cfg/citations/eprint/result.xml replace item.citation('default') with item.citation('display'). (N.B. you may need to modify other citation styles if they have been created for your archive).


6. Reload webserver or reload configuration through the Admin page's Config. Tools tab.