Not sure whether this is a bug or a feature: a refine block is empty when there are no tags available for refinement. I'd rather have the refine block not display at all when there's nothing to refine.

Comments

Bèr Kessels’s picture

Assigned: Unassigned » Bèr Kessels

acknowleged, thanks for the report.

mo6’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

This quick patch doesn't show the block when no content is available.

Bèr Kessels’s picture

Status: Needs review » Needs work

This is not a really nice solution. As you state 'a quick fix'. Too quick to be committed just like this, though :)

I think we should simply make the theme function a tad smarter and tell it not to return empty ULs and LIs

mo6’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB

True, too quick perhaps. Here's a new patch which lets refine_by_taxo_build_body return an empty string when there's no content to display instead of an empty list. That's cleaner. Also, refine_by_taxo_view_blocks then shows the block only when there is content (no empty string) to display.

mo6’s picture

StatusFileSize
new4.51 KB

In addition to the above patch, this patch also fixes a typo and cleans up the code a bit.

Bèr Kessels’s picture

Comitted #4 in a slightly modified version to HEAD of this module.

I suggest you read http://drupal.org/node/318, the coding standards. Eventhough your style may be 'cleaner' for your own work, it violates about all the guidelines in Drupal :). For one, if () is ALWAYS accompanied by a {} in Drupal. We dont ever write } else { one one line, etceteras.

Bèr Kessels’s picture

Status: Needs review » Fixed

... bunt in any case: thank you for the patch and the hard work. It is much appreciated!

mo6’s picture

#6 noted. Thanks, Bèr!

Anonymous’s picture

Status: Fixed » Closed (fixed)