Kirby CMS/php: Checking the file type in order to apply varying markup?

Working with the Kirby CMS, I’m trying to pull all the files of a page and apply different markup to images and videos. In Kirby, there is the $file->type() command, which I think I would have to use in an if-statement in order to distuniguish the files, but my current code is not working. What I tried is this:

<?php
$page = page('PageTitle');
$page_files = $page->files();
?>

sortBy('sort', 'asc') as $page_file): ?> type() == 'image') { ?>
url() ?>'); background-size: cover; height: 100vh;">
<?php endif; ?> <?php endforeach ?> </div> </div>

What am I doing wrong?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s