Colorbox trigger builds clunky html instead of array There is this view of which I configured the fields as follows:

Gallery images: exclude from display 
  - Background: in cck, this is a separate image field with multiple values called 'Gallery images' 

Title: default 

Custom text:
  - Exclude from display 
  - No results behavior: Hide if empty checked + Hide rewriting if empty checked

Colorbox trigger: 
 -  trigger field: custom text 
 -  popup: [field_project_gallery_images] 
 -  No results behavior: Hide if empty checked + Hide rewriting if empty checked

This works nicely in itself, colorbox shows a nice slideshow after clicking on the custom text. The problem is that the colorbox trigger should only be output if there are actually images uploaded to the gallery images field. I other words, Hide rewriting if empty checked leaves me with no success.

Which isn't a surprise when dpm($fields). It shows the gallery images field as one chunk of HTML entirely instead of an array. dpm($fields) output comes down to the following if that makes sense: 

    &lt;?php 

$fields['colorobox']['content']['&lt;span class="field-content"&gt;&lt;a href="/en?width=100%25&amp;amp;height=100%25&amp;amp;inline=true#colorbox-inline-3" class="colorbox-inline" rel=""&gt;Meer foto's&lt;/a&gt;&lt;div style="display: none;"&gt;&lt;div id="colorbox-inline-3"&gt;&lt;div id="field-slideshow-3-wrapper" class="field-slideshow-wrapper"&gt; &lt;div class="field-slideshow field-slideshow-3 effect-fade timeout-0 with-pager with-controls" style="width:680px; height:380px"&gt; &lt;div class="field-slideshow-slide field-slideshow-slide-1 even first"&gt; &lt;img class="field-slideshow-image field-slideshow-image-1" typeof="foaf:Image" src="http://multitech.id2r.net/sites/default/files/styles/colorbox_trigger/public/sd14-la-001_0.jpg?itok=8h7_PaP3" width="680" height="380" alt="" /&gt; &lt;/div&gt; &lt;div class="field-slideshow-slide field-slideshow-slide-2 odd" style="display:none;"&gt; &lt;img class="field-slideshow-image field-slideshow-image-2" typeof="foaf:Image" src="http://multitech.id2r.net/sites/default/files/styles/colorbox_trigger/public/sd14-la-002_0.jpg?itok=as53SCju" width="680" height="380" alt="" /&gt; &lt;/div&gt; &lt;div class="field-slideshow-slide field-slideshow-slide-3 even last" style="display:none;"&gt; &lt;img class="field-slideshow-image field-slideshow-image-3" typeof="foaf:Image" src="http://multitech.id2r.net/sites/default/files/styles/colorbox_trigger/public/sd14-la-003.jpg?itok=PtCO9nvK" width="680" height="380" alt="" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="field-slideshow-3-controls" class="field-slideshow-controls"&gt; &lt;a href="#" class="prev"&gt;Prev&lt;/a&gt; &lt;a href="#" class="next"&gt;Next&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/span&gt;']

?&gt;


No wonder there is no 0 to interpret as an empty field. This way, I can't loop through it and hide if count 0. To count the characters of the HTML would be way too dirty. But then, what can I do?
This is unfortunately just the way the colorbox module works.

Because it is possible to put any content in a views colorbox it is set up to handle anything in a very generic way, which means it doesn't handle single images in the most effective way and the trigger field way of configuring things is more complex than is needed in some cases.

I opened a similar issue about resizing the colorbox based on images, which you also cannot currently do because of the same issue of the way it has been implemented.

It is something I believe the module maintainer could fix though.
I would recommend opening a feature request issue on drupal.org at https://drupal.org/project/issues/colorbox?categories=All