From EPrints Documentation
Revision as of 17:25, 15 March 2023 by Pod2wiki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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


Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


EPrints::Apache::Template - Template Applying Module

User Comments


When HTML pages are served by EPrints they are processed through a template written in XML. Most repositories will have two templates - default.xml for HTTP and secure.xml for HTTPS.

Templates are parsed at server start-up and any included phrases are replaced at that point. Because templates persist over the lifetime of a server you do not typically perform any logic within the template itself, instead use a pin generated via Custom Pins.

The page content is added to the template via <epc:pins>.

User Comments


 <?xml version="1.0" standalone="no"?>
 <!DOCTYPE html SYSTEM "entities.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epc="http://eprints.org/ep3/control">
     <title><epc:pin ref="title" textonly="yes"/> - <epc:phrase ref="archive_name"/></title>

User Comments

Custom Pins

In cfg.d/dynamic_template.pl:

 $c->{dynamic_template}->{function} = sub {
   my( $repo, $parts ) = @_;
   $parts->{mypin} = $repo->xml->create_text_node( "Hello, World!" );

In archives/[archiveid]/cfg/templates/default.xml (copy from lib/templates/default.xml if not already exists):

 <epc:pin ref="mypin" />

Or, for just the text content of a pin:

 <epc:pin ref="mypin" textonly="yes" />

User Comments

Default Pins

User Comments


The title of the page.

User Comments


The page content.

User Comments


HTML <head> includes for the login status of the user - currently just some JavaScript variables.

User Comments


Page-specific HTML <head> contents.

User Comments



User Comments


A menu containing EPrints::Plugin::Screens that appear in key_tools. The content from each plugin's render_action_link is rendered as a HTML <ul> list.

Historically this was the login/logout links plus key_tools but since 3.3 login/logout are Screen plugins as well.

User Comments


The render_action_link from EPrints::Plugin::Screen::SetLang.

User Comments


User Comments


$rc = EPrints::Apache::Template::handler( $r )

Handler for applying site layout templates.

User Comments


The directories scanned for template sources are in EPrints::Repository/template_dirs.

User Comments


© Copyright 2023 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.



This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments