EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #04318
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Rendering a metafield - use different format in Listing and Abstract page
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] Rendering a metafield - use different format in Listing and Abstract page
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Wed, 17 Jun 2015 16:47:48 +0000
Hi,
I'd like to be able to apply a different rendering to a field if it's being displayed in a listing (e.g. the Review screen) to how it gets rendered 'normally'.
In this specific case, a compound field is normally rendered as a table:
+----------+----------+
| Sub A | Sub B |
+----------+----------+
| Val 1A | Val 1B |
| Val 2A | Val 2B |
| Val 3A | Val 3B |
+----------+----------+
This rendering is OK on an abstract page, but when using the compound field as a review column, I want to render is as a list:
* Val 1B (Val 1A)
* Val 2B (Val 2A)
* Val 3B (Val 3A)
Is there a way (in the render_value of a field) to determine if the field is being rendered as part of a listing?
I've got access to the $session - so was thinking along the lines of (CAUTION: nonsense code!)
if( $session->{screen}->isa( "EPrints::Screen::Listing" ) ){
#do list rendering
} else {
#revert to normal table rendering
}
but I can't quite get my head around going from session to screen. Any pointers welcome!
I may be missing something obvious too - e.g. if there's a citation style that I should use to do this!
Cheers,
John
- Follow-Ups:
- [EP-tech] Re: Rendering a metafield - use different format in Listing and Abstract page
- From: Adam Field <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: Rendering a metafield - use different format in Listing and Abstract page
- Prev by Date: [EP-tech] Re: OAI harvesting / records moving from live to buffer (or other non-deletion datasets).
- Next by Date: [EP-tech] Item Type - magazines and newspapers
- Previous by thread: [EP-tech] Problem with dependencies when installing
- Next by thread: [EP-tech] Re: Rendering a metafield - use different format in Listing and Abstract page
- Index(es):
