Difference between revisions of "Limit names shown.pl"

From EPrints Documentation
Jump to: navigation, search
(Added page about config file.)
 
m
Line 2: Line 2:
 
{{cfgd}}
 
{{cfgd}}
  
'''limit names shown.pl''' contains configuration for limiting the number of names shown in a citation.  This assigns a render function to '''<code>$c->{limit_names_shown}</code>''' which can then be assigned to the <code>render_value</code> attribute of a virtual field with the same name as the original [[API:EPrints/MetaField/Name|name]] field but appended with ''_limited''.  This virtual field can also <code>render_limit</code> and <code>render_dynamic</code> attributes to specify how many names to limit to and whether the citation can be expanded to show all names.  For more details see [[Limiting names shown]]
+
'''limit names shown.pl''' contains configuration for limiting the number of names shown in a citation.  This assigns a render function to '''<code>$c->{limit_names_shown}</code>''' which can then be assigned to the <code>render_value</code> attribute of a virtual field with the same name as the original [[API:EPrints/MetaField/Name|name]] field but appended with ''_limited''.  This virtual field can also <code>render_limit</code> and <code>render_dynamic</code> 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 ==
 
== Example ==

Revision as of 16:31, 4 February 2022

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,
};