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
Using Page ID in Templates
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!
From [[EPrints 3.4.3]] onwards, it is possible to include the ID of a page dynamically into its template. This facilitates writing page-specific CSS to control the appearance of specific pages and the HTML elements they contain. This is acheived by setting a pin for the page ID, which is generated from the page being loaded. EPrints has two main types of pages: ;Static :This includes <tt>.xpage</tt> files found under <tt>[[Archives/ARCHIVEID/cfg/static/|cfg/static/]]</tt> or <tt>[[Archives/ARCHIVEID/cfg/lang/en/static/|cfg/lang/en/static]]</tt>, such as the homepage or information page, eprint abstract/summary pages (e.g. <tt>/id/eprint/123/</tt>) and browse view pages (e.g. /view/year/2022.html</tt>). ;Dynamic :This includes pages generated from a [[Screen Plugins]], such as the search pages and back-end management/adminstration pages for editing eprints or managing the subject tree. Depending on the type of page the page ID pin will take on a different form. AlL dynamic pages will use the class name of the Screen plugin, converting non-alphanumeric (nor underscore) characters into underscores. So <tt>EPrint::Edit</tt> becomes <tt>EPrint_Edit</tt>. Static pages will use the path of the static page, prepended by <tt>static</tt>. So the homepage which is on the root of the path will just have the page ID <tt>static</tt> whereas the information page will have the page ID <tt>static_information</tt>. Abstract pages will have the page ID <tt>static_abstract</tt> and browse view pages will have the Page ID <tt>static_view_year</tt> for the homepage of the year view <tt>static_view_year</tt> for an index of the year view and <tt>static_view_year_page</tt> for a listing for a particular year. Where a browse view may have additional menu pages like for different letters of the alphabet for the creators browse view, if you click to go to one of these menus the page ID will append <tt>_index</tt> (e.g. <tt>static_view_creators_index</tt>. To apply the page ID pin to a template you need to use the markup <tt>{pin:page_id}</tt>. Let us say you want to add this page ID as the <tt>id</tt> to the <tt><body></tt> tag of the template this might look as follows: <body id="page_{pin:page_id}"> This would further prepend the prefix <tt>page_</tt> to the ID of the body tag, so if you loaded an abstract page (after refreshing abstracts) it would look like: <body id="page_static_abstract"> This could then be used in some custom CSS file to maybe reduce the size of the <tt>h1</tt> heading because your publications have very long titles and the font size is too large for abstract pages. E.g. #page_static_abstract h1#page-title { font-size: 1.8em; } You can place the markup for the page ID pin under whichever attribute of whatever element you want. It will only work in template files and not in static, citation or workflow files. [[Category:Howto]] [[Category:Manual]]
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)