Hey,
I have been wondering,
I tried to add a field from all pages which has a basic number but have had trouble with it…
my code was about like that:
<?php foreach ( $pages->find('subpage')->children()->visible() as $subpage): ?> <?php $sum = $sum + $subpage->fieldwithnumber() ?> <?php endforeach ?> <?php echo $sum; ?>
The result has been that it’ll add a “one” for each subpage…
When just giving it a tried to echo’ing $subpage->fieldwithnumber() without any calculation it’ll show each number just right. But the calculation itself has failed.
Are there limits such as whole numbers, as well as something like “8.1234”
Any hints?
Cheers.