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
How to Create Cover Images in EPrints 3
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!
This describes how to generate cover images on the abstract pages. Cover images are rendered differently from other document types. === Create a new document type "coverimage" === Add following line to [[Archives/ARCHIVEID/cfg/namedsets/|/opt/eprints3/archives/ARCHIVEID/cfg/namedsets/]]document cover_image Add a phrase to [[archives/ARCHIVEID/cfg/lang/en/phrases/|/opt/eprints3/archives/ARCHIVEID/cfg/lang/en/phrases/]]document_formats.xml <epp:phrase id="document_typename_cover_image">Cover Image</epp:phrase> Add phrases for all other languages your repository supports. When you deposit an image, EPrints 3 should automatically create thumbnails for you, of different sizes. === Add rendering of abstract pages === Edit [[eprint_render.pl|/opt/eprints3/archives/ARCHIVEID/cfg/cfg.d/eprint_render.pl]] This is the code that generates the abstract page. Decide where you want to put the cover image (e.g. next to the citation). Add the following code to simply add an HTML img tag: # Cover image foreach my $doc ( $eprint->get_all_documents() ) { if( $doc->get_type eq "cover_image" ) { $page->appendChild( $session->make_element( "img", src => $doc->thumbnail_url( "medium" ), alt => "Cover image" ) ); # Size may be one of small, medium, preview } } Next you might want to keep the cover image from appearing in the list of documents. Look for the lines that says # Available documents my @documents = $eprint->get_all_documents(); This part of the code is where the documents get rendered at the top of the abstract page. A few lines below in the foreach loop add code to stop rendering the cover image: foreach my $doc ( @documents ) { # Do not show cover image in document list. next if $doc->get_type eq "cover_image"; ... === Do not forget to restart Apache! === Restart Apache to make changes effective. === Run generate_abstracts === Run generate_abstracts (you can pass in the ID of a record with a "cover_image" document) and reload the abstract page - you should see the cover image displayed near the top of the page. [[Category:Howto]] [[Category:Customisation]]
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)