EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #10003
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] "newbie" questions about customizing and static pages
- To: <eprints-tech@ecs.soton.ac.uk>, Marcin Roguski <mt.roguski@uw.edu.pl>
- Subject: Re: [EP-tech] "newbie" questions about customizing and static pages
- From: David R Newman <drn@ecs.soton.ac.uk>
- Date: Fri, 28 Feb 2025 10:20:55 +0000
Hi Marcin,
1) Probably the easiest way to do this is to edit you static homepage and empty the xpage:title tag. To take it from something like:
<xpage:title>Welcome to
<epc:phrase ref="archive_name" /></xpage:title>
To:
<xpage:title/>
Typically this would be under your archive's directory (e.g. /opt/eprints3/archives/your_archive/) in either cfg/lang/en/static/index.xpage (assuming and English language repository) or possibly cfg/static/index.xpage. If you don't have a file in either of these directories then you may be using the default version, whose location may vary depending on the version of EPrints you are running. Based on looking at your homepage in the link you sent, I doubt you are using the default location, unless someone had previous edited this rather than creating an archive level version.
2) Off the top of my head I cannot think of a code snippet or pin you could use to insert a whole division tree on a static page. This is theoretically possible as you can right a function that generate the HTML and then there are was of referencing that in a static page. It is possible someone on the list, maybe have done it. Method 3 on https://wiki.eprints.org/w/How_to_display_specific_contributors is the general way I would achieve this, by what is called a custom EPScript function. What you need to do is. However, as it is a static page that is just making a generic call rather than a call against a data object (e.g. an eprint). I would call you function something like run_display_subject_tree, the run_ part is essential to make this work. You would then call this script in a static page like:
<epc:print expr="display_subject_tree('divisions')"/>
The Divisions would be the root node of the overall subject tree you want to display, as you will otherwise get parts of the overall subject tree that are not divisions. Here is the rough skeleton of such a function:
sub run__display subject_tree{
my( $self, $state, $root_node ) = @_;
if( !defined $root_node->[0] ){
$self->runtime_error( "You must specify a root node for the top of the subject tree." );
}
$root_node = $root_node->[0];my $session = $self->{session};
my $dataset = $session->get_dataset( 'subject' );
my $root_subject = $dataset->dataobj( $root_node );
if( !defined $root_subject
)
{
$self->runtime_error( "The root node
'$root_node' does not exist in the subject tree." );
}
my $ul = $seession>make_element( "ul" );# Recurse through the subject tree for divisions and add elements to the ul and li elements or nested uls if they are child nodes.
return [ $ul, "XHTML" ];}
I am not sure the most efficient way to recurse though the subject tree. You may need to add another function to do this underneath. This should not start run_. I would call it something like _recurse_subject_tree. You may need to better understand the properties/functions for a subject data object which are described at:
https://wiki.eprints.org/w/API:EPrints/DataObj/Subject
Hopefully, this gives you a start on what you need to do. Even with a fair amount of experience, I reckon it would take me an hour or two to get something displaying on a static page with which I am happy.
Regards
David Newman
CAUTION: This e-mail originated outside the University of Southampton. CAUTION: This e-mail originated outside the University of Southampton. Hello everybody, I recently "inherited" and am slowly upgrading and customising an ePrints installation. The learning curve was pretty smooth with only a handful of insignificant hiccups. I still have some questions about making this installation suit our needs. For those curious: this is the one I'm improving: https://eur03.safelinks.protection.outlook.com/?url=""> (compared to https://eur03.safelinks.protection.outlook.com/?url="">) Question 1) I'd like to get rid of the title pin for index/home page. The documentation mentions using test, but what should I test for? Is there a constant/variable I can match against? question 2) I have pages like this one: https://eur03.safelinks.protection.outlook.com/?url=""> On the old site, the previous admin "meticulously" inserted issues by hand as html, I however want to one-up this. Is there a code snippet I can use on xpage to insert entire division tree? -- Marcin Roguski Specjalista informatyk Wydział Dziennikarstwa, Informacji i Bibliologii UW tel. (22) 55 23 714
*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List *** Archive: https://www.eprints.org/tech.php/ *** EPrints community wiki: https://wiki.eprints.org/
- Follow-Ups:
- Re: [EP-tech] "newbie" questions about customizing and static pages
- From: Marcin Roguski <mt.roguski@uw.edu.pl>
- Re: [EP-tech] "newbie" questions about customizing and static pages
- References:
- [EP-tech] "newbie" questions about customizing and static pages
- From: Marcin Roguski <mt.roguski@uw.edu.pl>
- [EP-tech] "newbie" questions about customizing and static pages
- Prev by Date: [EP-tech] "newbie" questions about customizing and static pages
- Next by Date: Re: [EP-tech] "newbie" questions about customizing and static pages
- Previous by thread: [EP-tech] "newbie" questions about customizing and static pages
- Next by thread: Re: [EP-tech] "newbie" questions about customizing and static pages
- Index(es):