RC1 - Looper Consumer count variable

My situation is that I would like to be able to update dynamically how many items are placed in a particular container and divide this by a number that would be rounded to an integer.

I don’t believe despite the dynamic content icon you can get it to work unless it has a hard coded number.
(example does not work)
image

Small feature request if we can get the above working
This extra attribute would be very handy for the looper count.
{{dc:looper:count divideby=“2” }}

Thanks

1 Like

I like this idea a lot, though my suggestion would be to abstract the calculation out of individual parameters for dynamic content, and instead have an ability to do something akin to the CSS calc() function, e.g.

calc( {{dc:looper:count}} / 2 )

Which could then lead to interesting interaction between different dynamic content.

A further of extension of this would be to come back to a feature request that I think was posed a couple years back now, which is to add some sort of conditional functioning too, e.g.

if( {{dc:looper:count}} == 2, "value if true", "value if false" )

Which I know we now have access to in the conditions settings for any element, but there are instances where conditionally changing the output into a single control makes more sense than making a duplicate of that element in the builder just to filter the two by conditions.

Just my 2 pence!
Love the calculation idea alone though

1 Like

All great ideas on templating. My dream is to implement twig (or something similar) and give everybody a robust set of templating features for Dynamic Content. It would solve about everything from math, formatting, macros, to loops. Some of the limitations are given by ThemeForest from talking with Alex, but I think with some work we could add a great set of features for Cornerstone and Pro.

2 Likes