Empty binary fields picked up in content list

Hi - I’m hoping this is something simple I’ve missed…

For our Image content type I have pretty a standard jsr-170 binary content list:

select rx:sys_contentid, rx:sys_folderid from rx:image where jcr:path like ‘//Sites/%’

My issue is that the Image content type contains two binary fields (one for thumbnail, one for a larger image) and regardless of whether only one or both of these fields contain images, the content list publishes both.

In the publish context, I have a location scheme for both fields which is something like:

$sys.pub_path + $sys.item.getProperty(“rx:sys_contentid”).String + $identifier + $sys.item.getProperty(“rx:image_ext”).String

($identifier being ‘sml’ or ‘lg’ depending on which field it is)

Therefore, if I only create a thumbnail image in the content type, this publishes correctly as 12345sml.jpg, however, I also end up with another 0kb file in the same location called 12345lg.jpg

This is more annoying than a serious issue, but does anybody know how I can prevent this?


Hi Jerome

You write two content lists, one for each template.

select rx:sys_contentid, rx:sys_folderid from rx:image where jcr:path like '//Sites/%' AND rx:img1_filename <> ''

select rx:sys_contentid, rx:sys_folderid from rx:image where jcr:path like '//Sites/%' AND rx:img2_filename <> ''


Hi James

Tried this, but it still doesn’t seem to work. When I test the query using the debugger, it works as expected, removing all content with a null record for the filename field. This is my query:

select rx:sys_contentid, rx:sys_folderid, rx:thumbimage_size, rx:thumbimage_filename, rx:thumbimage_ext from rx:ntuimage where jcr:path like ‘//Sites%’ and rx:thumbimage_filename is not null

(I’ve tried using <> ‘’ as you suggested, but this returned no results in the debugger.)

However, when I put this query into the content list and preview it, all images are returned, with the publisher creating location schemes and 0kb files for those fields that are empty.

I think I have fixed this problem now - I was using the incorrect template expander. I was using the sys_SiteTemplateExpander extension, however, when I switched this to sys_ListTemplateExpander the content list returned the expected results.