EPrints Technical Mailing List Archive

Message: #08991


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

Re: [EP-tech] change the homepage title


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

It worked like a charm (3.3 with frontpage template)! Thanks!

It is documented here: https://wiki.eprints.org/w/API:perl_lib/EPrints/Apache/Template.pm


Il 05/07/22 10:49, David R Newman via Eprints-tech ha scritto:

Hi Yuri,

For EPrints 3.4.3 I implemented a solution that may address your question:

https://github.com/eprints/eprints3.4/issues/111

This can be implemented by adding converting a simple <body> tag in your template to something like:

<body id="page_{pin:page_id}">

This can then be used in CSS by starting the entry with:

#page_

An example might be that you want to change the summary box on abstract pages only:

#page_static_abstract .ep_summary_box

Or you may want to change the report title heading on the IRStats2 report pages:

#page_IRStats2_Report .report_title

I had been meaning to document this properly on the wiki but had not got round to it.  As I did it sometime before the release of 3.4.3, I did not want to document it for people to then find they could to use it until 3.4.3 was out.  Then when 3.4.3 was released, I forgot about writing the documentation.

I guess this functionality could be used to solve your problem in the following way.  As the homepage has no path using the markup for the <body> tag I described above would use:

#page_static

So say you wanted the hide the main heading on the homepage you could add the following to the CSS:

#page_static h1#page-title {
    display: none;
}

If you are not currently using 3.4.3, it is not straightforward to backport this code for earlier versions of EPrints, especially pre-3.4.  You could always just create a separate template for your homepage.  This is quite common across EPrints repositories.  This would allow you to have complete control over your <title> and <h1> tags, as any changes would only affect your homepage.  To make the static page for your homepage use this alternative template, you just need to add it to the XML markup for the static page.  Lets say the template is called frontpage.xml you would add (somewhere before the xpage:body tag):

<xpage:template>frontpage</xpage:template>

Obviously, having a separate template for your homepage will add to your workload if/when you choose to rebrand your repository.

Regards

David Newman

On 05/07/2022 8:32 am, Yuri via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.

Hi!

 I would like to display any title in the eprints homepage (xpage) but still have a page title (<title> tag). Is this possible? Also a css solution is ok. Could be the h1 title in the page be marked by a class (for example the filename of the xpage)?


*** 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/

*** 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/