Active
Project:
Galleria
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2009 at 21:45 UTC
Updated:
12 Oct 2009 at 16:45 UTC
First of all let me thank you for this great module and for the imagefield support.
The problem occurs if you put a empty imagefield into a fieldgroup.
Expected behaviour:
Nothing gets displayed because the imagefield is empty.
Erroneous behaviour:
An "empty " fieldgroup is display.
Reason:
The galleria template (galleria.tpl.php) outputs
<div id="galleria-content">
<div id="main-image"></div>
<div class="item-list"></div>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
//Hide images while Galleria is loading
$('ul.gallery img').css('display', 'none');
//--><!]]>
</script>
</div>
even if $image_count is 0.
Solution:
Wrap the HTML into
if ($image_count != 0) :
....
endif;
So that nothing is returned, not even one " " (took me an hour to find that...).
Sincerely Markus
Comments
Comment #1
Mark Theunissen commentedThanks for the clear bug report, committed!
Comment #3
worldwidemv commentedThank you for the quick fix.
Unfortunately the problem still exists.
Line 9 and line 29 in galleria.tpl.php are newlines.
Line 9 seams to be the problem because the template file returns something like "\n".
Maybe CCK fieldgroup should be not this strict and ignore newline and space (with trim perhaps).
I am not familiar with the Drupal coding standards and therefore can't decide if this is still a galleria issue.
Sincerely Markus