I have a CMS collection where i created a column called card_tags. It is a text field. I gave values to this text field as comma separated. In the builder, I have a loop of container, inside this container, i have paragraph. In that paragraph, i want to show the comma separated values, one by one in each container. Currently i have like the below snap which i achieved by using get column function. If i use split and index 0 on top of it, i get only one value and rest are not showing up in the loop in next next loop containers. But i would like to have as shopping cooking fuel rewards in seperate container. The purpose behind this is i can use them as tags and this tags are not in fixed count, it varies based on the product count which is dynamic to the product. Could you please guide me how can i achieve this?
I’m not part of DivHunt, but do you have a possible maximum number of tags? If, for example, you would only have 20 tags, then I’d remove the loop and have 20 containers with paragraphs in them. The first would work as you’ve done it (get column, split by ‘,’, then index ‘0’), the second would be the same, only this time index ‘1’, all the way to the last one which would be index ‘19’. That should give you all bits of your array into 20 containers. Now all that’s left is to change the visibility conditions to something like get column, split by ‘,’, index (0,1,2,3 etc depending on the position), not empty, or not null (I can never remember). That will ensure the containers with no data don’t show on your site.
This may all be doable from within a loop, too, but I’m not at my machine and didn’t want to lead you down the wrong track.