Trying to use a count of children pages to determine the number of columns
I am using bootstrap 3 and have an element that fits into columns but the number of cselements can vary. I have used .count and some if statements to vary the col width class based upon the number of items but wonder if there is a cleaner way of doing this:
Trying to use a count of children pages to determine the number of columns
I am using bootstrap 3 and have an element that fits into columns but the number of cselements can vary. I have used .count and some if statements to vary the col width class based upon the number of items but wonder if there is a cleaner way of doing this:
I know I could use Umbraco 7.2 new grid tool for this but have not got time to delve into the finer details of how it all works etc.
switch (count) {
case 3:
cols = 4;
break;
case 4:
cols = 3;
break;
}
Thanks but unfortuantely this does not seem to work :(
I get this error:
A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type
Hi William
Try declare you "count" variable as a int:
/Bjarne
Worked a treat thanks
is working on a reply...