Show if asset_count is greater than one


(gja) #1

Hi,

 

I have an asset listing that is creating a collection of checkboxes, and adding to the end of the collection an "All" checkbox.   However, if there is only 1 checkbox it is a bit silly to add an All check box too.

 

In matrix (4.18.2)  I have an asset listing  and am adding the static all checkbox code to the page contents bodycopy.

 

Ideally I'd like ( if %asset_count% >1){ add all code}

 

I've checked conditional keywords on a paintlayout but asset_count doesn't seem to be listed.

 

Any thoughts if this is doable?

 

Thanks Georgina.


(Talk) #2

Hi Georgina, you could try %asset_count^gt:1:<label>All<input type="checkbox" name="all"></label>%

 

^gt:1 means if the number is greater than 1


(gja) #3

Hi Jeremy,

 

Thanks for that - worked like a treat. :)

 

I've used keyword modifiers before, but it just didn't occur to me to use one in this case.

 

Georgina