https://wiki.eprints.org/w/index.php?title=Abstract_page_template&feed=atom&action=historyAbstract page template - Revision history2024-03-28T08:38:29ZRevision history for this page on the wikiMediaWiki 1.31.8https://wiki.eprints.org/w/index.php?title=Abstract_page_template&diff=11009&oldid=prevLibjlrs: Created page,2014-10-10T10:42:50Z<p>Created page,</p>
<p><b>New page</b></p><div>If you want to apply a specific template to an item's abstract page (summary page), you can return a template name from the 'eprint_render' function.<br />
See: https://github.com/eprints/eprints/commit/4656cbc1398f52ddbef7d245795d12f7dc35d8a2<br />
<br />
<source lang="perl"><br />
$c->{eprint_render} = sub<br />
{<br />
# ...<br />
# all the normal stuff eprint_render stuff<br />
# ...<br />
<br />
#example shows using a specific template for articles. You can test for <br />
# whatever you want - as long as you return a valid template name, or <br />
#leave $template undefined - in which case the default template is used.<br />
my $template;<br />
if( $eprint->value( "type" ) eq "article" ){<br />
$template = "article_template";<br />
}<br />
<br />
#normally returns just $page, $title, $links, but can return $template too!<br />
return ( $page, $title, $links, $template );<br />
}<br />
</source><br />
<br />
Tested in EPrints-3.3.10 and EPrints-3.3.12. Probably works on many other versions.</div>Libjlrs