Hello! I’ve created a front page for my website that pulls blog posts into neat resizing tiles. The images are placed inside a grid container tile (blog_container_child) that is nested inside a flexbox (blog_tiling_subcontainer). This is the code I have written:
<?php snippet('header') ?>
<div class="blog_tiling_subcontainer">
<?php foreach ($site->children()->listed() as $Blog): ?>
<?php foreach ($Blog->children()->listed() as $page): ?>
<div class="blog_container_child">
<div class="blog_tile_image"><?= $page->image() ?></div>
<p class="blog_tile_text"><?= $page->text() ?></p>
</div>
<?php endforeach ?>
<?php endforeach ?>
</div>
</body>
</html>
I want to crop and center the images into their section on the tile. Inspecting on the browser shows that the image container - item (blog_tile_image) fits the desired dimensions on the tiles grid container. When I try the following, I get crashes:
<div class="blog_tile_image"><?= $page->image()->crop() ?></div>
I’m a new coder so I know there’s probably some kind of syntax error that I’m missing, I’d appreciate any help you can give.