Real php beginner here, sorry for the basic questions, but I didn't find any solution.
question: I am looping through the children of a page in processwire. I got help in the processwire forum with this code:
<?php foreach ($page->children() as $product): ?> <div class='single-product-wrapper'> <?php $thumb = $img->size(100, 100); ?> <img src="<?php echo $product->thumb->first()->url; ?> "/> <p><?php echo $product->inhalt1; ?></p> </div> <?php endforeach; ?>
But, when I try to write it in regular PHP, I don't see the images on my website What am I writing wrong? I think the following php is the same as the above.
<div class='single-product-wrapper'>
<?php foreach ($page->children() as $product){
echo $product->img->first()->url;
echo $product->inhalt1;
}
?>
</div>
2. question:
How do I write a resize of the images into thumbnails in shorthand php? Now I get the fullsize images on the page.
Thanks a lot Jakob