Use of Conditions in BloX Column sets/columns
I would like to be able to filter BloX column Panel Items & Values based on a conditional. In my use case we have something similar to the mockup below:
The goal is to be able to filter the panel values in each column in the column set to a specific item. Column 1 would show the photo of the top ranked breed, the name of that breed and the number of breeders. Column 2 would show the photo of the 2nd ranked breed, the name of that breed and the number of breeders. This would continue for the 4 top breeds. It's straight forward to rank the number of breeders by breed in a widget calc, but it's not clear to me how to apply that to show the data about that breed in each column.
The attached JSON file from BloX shows the first part of the column set.
Thanks for your assistance with this - Jim
Please use this JSON:
{ "style": ".content{counter-reset:section} .casesrank::before {counter-increment: section; content: 'Top ' counter(section) ' Product';} .productitems{float:left; border:2px solid grey}", "showCarousel": false, "body": [ { "type": "Container", "class": "titlearea", "width": "100%", "items": [ { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "left", "color": "default", "text": "Top 6 Products in {panel:xxxx}" }, { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "left", "color": "default", "text": "{panel:xxx} Units: {panel:yyy} of Total Sold" }, { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "left", "color": "default", "text": "{panel:mmmm} of Total Net Sales" }, { "type": "TextBlock", "spacing":"small" } ] }, { "type": "Container", "width": "16%", "class": "productitems", "items": [ { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "center", "spacing": "small", "class": "casesrank", "color": "default", "text": "" }, { "type": "Image", "url": "{panel:ProductImageURL}", "spacing": "small", "horizontalAlignment": "center", "size": "small" }, { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "center", "spacing": "small", "color": "default", "text": "{panel:ProductTitle}" }, { "type": "TextBlock", "size": "light", "weight": "bold", "horizontalAlignment": "center", "spacing": "small", "color": "default", "text": "{panel:CasesSold} units" } ] } ] }
And add below widget script to remove all containers except first:
widget.on('ready', function(se, ev){ $("div.titlearea").not(":first").hide(); })
Result:
-Hari