<br><br><div class="gmail_quote">El Wed Oct 29 2014 at 1:40:34, Mark Tompsett (<<a href="mailto:mtompset@hotmail.com">mtompset@hotmail.com</a>>) escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings,<br>
<br>
<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[%<br>
IF ( SEARCH_RESULT.normalized_ean ) %][% SEARCH_RESULT.normalized_ean %][%<br>
ELSE %][% SEARCH_RESULT.normalized_isbn %][% END %]" id="coce-thumbnail[%<br>
loop.count %]"></span><br>
<br>
This fails to meet coding guidelines<br>
(<a href="http://wiki.koha-community.org/wiki/Coding_Guidelines#HTML1:_Template_Toolkit_markup_inside_HTML" target="_blank">http://wiki.koha-community.<u></u>org/wiki/Coding_Guidelines#<u></u>HTML1:_Template_Toolkit_<u></u>markup_inside_HTML</a>)<br>
The question is does the following fail too?<br>
<br>
<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[%<br>
SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]"<br>
id="coce-thumbnail[% loop.count %]"></span><br>
<br>
Because I really like it compared to the length IF/ELSE split.</blockquote><div><br></div><div>Stick with the big IF/ELSE split. It is more readable and no point "optimizing" that way.  Like this:</div><div><br></div><div>[%- IF SEARCH_RESULT.normalized_ean -%]</div><div><div><span style="block" title="[%- SEARCH_RESULT.biblionumber |url -%]" class="[%- SEARCH_RESULT.normalized_ean -%] id="coce-thumbnail[%- loop.count -%]"></span></div></div><div>[%- ELSE -%]</div><div><span style="block" title="[%- SEARCH_RESULT.biblionumber |url -%]" class="[%- SEARCH_RESULT.normalized_isbn -%] id="coce-thumbnail[%- loop.count -%]"></span></div><div>[%- END -%]<br></div><div><br></div><div>In more complex situations you could use template variables instead, for saving the correct value, something like:</div><div><br></div><div>[%- IF SEARCH_RESULT.normalized_ean -%]</div><div>  [%- normalized_identifier = SEARCH_RESULT.normalized_ean -%]<br></div><div>[%- ELSE -%]</div><div>  [%- normalized_identifier = SEARCH_RESULT.normalized_isbn -%]</div><div>[%- END -%]</div><div><br></div><div><div><span style="block" title="[%- SEARCH_RESULT.biblionumber |url -%]" class="[%- normalized_identifier -%] id="coce-thumbnail[%- loop.count -%]"></span></div></div><div><br></div><div>Only if you think is worth te trouble, of course.</div><div><br></div><div>Regards</div><div>To+</div><div><br></div></div>