EPrints Technical Mailing List Archive

Message: #06324

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

[EP-tech] Easier way to do this in a citation?

Hi all,


I’ve recently had to add a few new rules in a citation for a conference proceeding.  At the moment I have a number of checks that look something like this:


<if test="is_set(event_title)">

<print expr="event_title"/>


<if test="event_location">

<if test="is_set(event_title)">, </if>

<print expr="event_location"/>


<if test="is_set(event_dates)">, <print expr="event_dates"/></if>

<if test="is_set(event_title) or is_set(event_location) or is_set(event_dates)">.</if>


So it’ll only add a comma before the location if the title is supplied, etc. and the full-stop at the end if any event details are shown.  But, well, as you can see it’s a pretty messy way to do things and wondered if there were something a little more streamlined available that would allow you to supply a list of fields and it’ll then automatically put commas between values if the values are there and a full-stop at the end if needs be?  I’m only trying to do this with cite tags in citations/eprints/default.xml.


I did see a ‘pretty_list’ function in Compiled.pm that looks like it may do something like what I want, but despite trying I didn’t see how I could pull this into a citation nor could I find any documentation on the subject.  Is that possible?


If this kind of functionality doesn’t already exist, then what’s the best course of action to adding new types of actions to cite tags?  Is it possible to create my own class do add extra actions, or should I update existing modules? (which seems like a bad idea if ever wanting to upgrade).  Is there any documentation about doing this kind of thing?


Many thanks for any advice,





Andrew Collington
Web Programmer, ITS Client Services
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT

T: (01273) 872591 (ext. 2591)
E: a.p.collington@sussex.ac.uk