Limit names shown.pl

From EPrints Documentation
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Back to cfg.d

limit names shown.pl contains configuration for limiting the number of names shown in a citation. This assigns a render function to $c->{limit_names_shown} which can then be assigned to the render_value attribute of a virtual field with the same name as the original name field but appended with _limited. This virtual field can also render_limit and render_dynamic attributes to specify how many names to limit to and whether the citation can be expanded to show all names. For instructions for how to deploy this see Limiting names shown.

Example

push @{$c->{fields}->{eprint}},
{
  name => 'creators',
  type => 'compound',
  multiple => 1,
  fields => [
    {
      sub_name => 'name',
      type => 'name',
      hide_honourific => 1,
      hide_lineage => 1,
      family_first => 1,
    },
    {
      sub_name => 'id',
      type => 'text',
      input_cols => 20,
      allow_null => 1,
    }
  ],
  input_boxes => 4,
},

{
  name => 'creators_name_limited',
  type => 'name',
  virtual => 1,
  render_value => 'limit_names_shown',
  render_limit => 20,
  render_dynamic => 1,
};