Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
Views.pl
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==EPrints 3.2 example== ===cfg/cfg.d/views.pl=== { id => "target", # The 'name' for this view allow_null => 0, hide_empty => 1, menus => [ { fields => ["broker_reponame"], # The field(s) to use - in this case the 'reponame' sub-element of the 'broker' field new_column_at => [0], # force 2 columns, even if the # second is blank mode => "sections", open_first_section => 1, group_range_function => "EPrints::Update::Views::cluster_ranges_30", group_sorting_function => "EPrints::Update::Views::default_sort", }, ], order => "-date/title", citation => 'router', # This defines the file in cfg/citations/eprint/ layout => 'router', # This is used in Views.pm to determine how to # join individual citations together... }, This creates a view, which will be 2-columns wide. Two important definitions here are: * '''citation''' defines the citation file used to create the block of html for each record to be displayed, and * '''layout''' indicates how those blocks are joined together. ====Layout==== '''Layout''' can be one of: * paragraph (the default) puts <p> elements round each citation * orderedlist makes an ordered list (1,2,3,4 or whatever the CSS defines) * unorderedlist makes an unordered list * ''anything else'' just puts a newline (in the page source) after each citation ====citation==== In our example, we're using a home-made citation layout The citation file is in <code>/cfg/citations/eprint/</code> In the above view, we have defined the citation format to be '''router''', therefore we need a file called '''router.xml''' in the citations directory. Remember this format is used for each record, so needs to be complete in it's own right - and if you want records to line up vertically, you need to plan that in advance. <?xml version="1.0" ?> <!-- Full citation for an eprint. --> <cite:citation xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://eprints.org/ep3/control" xmlns:cite="http://eprints.org/ep3/citation" > <table class='ep_rt_citation'>; <tr><td colspan='2'> <choose> <when test="type = 'book' and is_set( creators )"> <span class='strong'><print expr="creators_name"/></span> </when> .... more code .... </choose> </td><td style="width:8em"> <if test="date"><span class='right strong'>(<print expr="date" opts="res=year"/>)</span></if> </td></tr> <tr><td style="width:50%"> <cite:linkhere><xhtml:em><print expr="title" opts="magicstop"/></xhtml:em></cite:linkhere> </td> <choose> .... more code <when test="type = 'article'"> <td> <if test="publication"><print expr="publication"/> <if test="volume">, <print expr="volume"/></if> <if test="number"> (<print expr="number"/>)</if> .</if> <if test="pagerange"> <print expr="pagerange"/>.</if> </td><td> <if test="issn"><span class='right'> ISSN <print expr="issn"/></span></if> </td> </when> .... more code </choose> </tr> <if test=" ! type.one_of( 'patent','thesis' )"> <if test="ispublished.one_of('unpub', 'submitted', 'inpress')"> <tr><td colspan='2'> (<print expr="ispublished"/>) </td></tr> </if> </if> </table> </cite:citation> This creates a table for each record, and CSS is used to manage the size & position of the various elements ===cfg/cfg.d/eprint_render.pl=== When viewing a record, the main abstract view page can also be altered In <code>cfg/cfg.d/eprint_render.pl</code>, towards the bottom of the subroutine <code>$c->{eprint_render}</code> is the following line: my $page = $eprint->render_citation( "router_page", %fragments, flags=>$flags ); Here, '''router_page''' is the name of the citation file for creating the abstract page..... '''router_page.xml''' in this case
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)