EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09171


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Different templates or depending on URI


Hi all,

In response to John's comment/question:

"This is possible in v3.3.16 (and probably earlier 3.3 versions. Not sure about 3.4):
$c->{
user_area_template} = 'user';"

On EPrints 3.4.x, if you want a different page template for the back-end admin pages compared to the front-end public pages, then you should create a template called default_internal.xml in the same directory as the default.xml template, (typically EPRINTS_PATH/archives/ARCHIVE_ID/cfg/lang/en/templates/).  EPrints 3.4 has packages default_internal.xml in both lib/templates/ and flavours/pub_lib/lang/en/templates/. Typically most people start by copying their current archive's default.xml to default_internal.xml in the same directory and then make the various modification they need.  However, you could create the default_internal.xml template from scratch, if you want something that looks completely different.  I can see that user_area_template is still referenced in /cgi/users/home and /cgi/respond_to_doc_request and this will supersede the default_internal.xml template if $c->{user_area_template} is defined.

From 3.4.3 onwards using page IDs in templates has been possible [1].  This allows you to write some bespoke CSS and only apply it to a particular type of page (e.g. abstract pages, browse view pages) or specific static pages (e.g. contact or policies page)  It also generates page IDs for dynamic and back-end pages (e.g. searches, phrase editor, edit subjects, review buffer, etc.) based on their screen plug-in name.  So the page ID for the "Send Test Email" page would be Admin_TestEmail whereas the ID for an abstract page would be either static_abstract or static_id_eprint_abstract if your have long URLs enabled (e.g. abstract pages are on URLs like https://example.eprints.org/id/eprint/77/).

Regards

David Newman

[1] https://wiki.eprints.org/w/Using_Page_ID_in_Templates

On 16/01/2023 15:50, Jens Witzel via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.

… i love your answer John – it works! 😃

 

Cheers from Switzerland
Jens

 

--
Jens Witzel
Zentrale Informatik
Universität Zürich
Stampfenbachstrasse 73
CH-8006 Zürich

mail:  jens.witzel@uzh.ch
phone: +41 44 63 56777
http://www.zi.uzh.ch

 

Von: John Salter <J.Salter@leeds.ac.uk>
Gesendet: Montag, 16. Januar 2023 16:39
An: eprints-tech@ecs.soton.ac.uk; Jens Witzel <jens.witzel@uzh.ch>
Betreff: RE: Different templates or depending on URI

 

This is possible in v3.3.16 (and probably earlier 3.3 versions. Not sure about 3.4):
$c->{user_area_template} = 'user';

 

This will use a template file 'user.xml'.

 

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Jens Witzel via Eprints-tech
Sent: 16 January 2023 15:30
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Different templates or depending on URI

 

CAUTION: This e-mail originated outside the University of Southampton.

 

Another question: is there a ‘<epc:if expr…>’ way inside a template or a config in general, to let front and backend have different looks or let there be different templates? E.g. depending on «/cgi/users» as URI? Otherwise I’ll have to use dynamic_template.pl

 

Any hint is welcome
Jens

--
Jens Witzel
Zentrale Informatik
Universität Zürich
Stampfenbachstrasse 73
CH-8006 Zürich

mail:  jens.witzel@uzh.ch
phone: +41 44 63 56777
http://www.zi.uzh.ch

 


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/