Merge pull request #1 from getkirby/texnixe/patch

Add check if page exists
This commit is contained in:
Sonja Broda
2019-07-01 16:38:54 +02:00
committed by GitHub

View File

@@ -5,8 +5,9 @@
<h1><?= $site->title() ?></h1>
</header>
<?php if ($photographyPage = page('photography')): ?>
<ul class="grid">
<?php foreach (page('photography')->children()->listed() as $album): ?>
<?php foreach ($photographyPage->children()->listed() as $album): ?>
<li>
<a href="<?= $album->url() ?>">
<figure>
@@ -23,6 +24,7 @@
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
</main>