<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I've solved this problem by using a virtual field with a custom renderer. The virtual field's render method reads the value from the actual field you're interested in and renders it differently. The problem with virtual fields is that I think they're hard to test for in epxml (and possibly also with is_set).<div class=""><br class=""></div><div class="">You can see an example from the tweepository package here:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/gobfrey/tweepository/blob/master/cfg/cfg.d/z_tweepository_libs.pl#L314" class="">https://github.com/gobfrey/tweepository/blob/master/cfg/cfg.d/z_tweepository_libs.pl#L314</a> (field definition)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/gobfrey/tweepository/blob/master/cfg/cfg.d/z_tweepository_libs.pl#L1710" class="">https://github.com/gobfrey/tweepository/blob/master/cfg/cfg.d/z_tweepository_libs.pl#L1710</a> (render method)</div><div class=""><br class=""><div class=""><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Adam Field</div><div class="">Business Relationship Manager and Community Lead<br class="">EPrints Services</div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 17 Jun 2015, at 17:47, John Salter <<a href="mailto:J.Salter@leeds.ac.uk" class="">J.Salter@leeds.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi,<br class="">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'.<br class=""><br class="">In this specific case, a compound field is normally rendered as a table:<br class="">+----------+----------+<br class="">| Sub A | Sub B |<br class="">+----------+----------+<br class="">| Val 1A | Val 1B |<br class="">| Val 2A | Val 2B |<br class="">| Val 3A | Val 3B |<br class="">+----------+----------+<br class=""><br class="">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:<br class="">* Val 1B (Val 1A)<br class="">* Val 2B (Val 2A)<br class="">* Val 3B (Val 3A)<br class=""><br class="">Is there a way (in the render_value of a field) to determine if the field is being rendered as part of a listing?<br class="">I've got access to the $session - so was thinking along the lines of (CAUTION: nonsense code!)<br class="">if( $session->{screen}->isa( "EPrints::Screen::Listing" ) ){<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>#do list rendering<br class="">} else {<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>#revert to normal table rendering<br class="">}<br class=""><br class="">but I can't quite get my head around going from session to screen. Any pointers welcome!<br class=""><br class="">I may be missing something obvious too - e.g. if there's a citation style that I should use to do this!<br class=""><br class="">Cheers,<br class="">John<br class=""><br class=""><br class=""><br class="">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">*** Archive: <a href="http://www.eprints.org/tech.php/" class="">http://www.eprints.org/tech.php/</a><br class="">*** EPrints community wiki: <a href="http://wiki.eprints.org/" class="">http://wiki.eprints.org/</a><br class="">*** EPrints developers Forum: <a href="http://forum.eprints.org/" class="">http://forum.eprints.org/</a><br class=""></div></blockquote></div><br class=""></div></div></div></body></html>