Skip to content

Instantly share code, notes, and snippets.

Working from home

Christopher Boutillé starckio

Working from home
View GitHub Profile
starckio / blueprints--contact.yml
Last active Feb 8, 2019 — forked from bastianallgeier/controllers--contact.php
Plain contactform example for Kirby 2
View blueprints--contact.yml
title: Contact
pages: false
label: Page
type: text
width: 1/4
label: Title
type: text
View or.php
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>">
View submodules
git submodule add
git submodule add
git submodule update --init --recursive
View blog.php
$blogs = $pages->findByUID('blog1', 'blog2');
$articles = $blogs->children()->sortBy('date', 'desc');
// if you want you can add a limit or pagination to that set of articles
// afterwards just use a regular foreach loop to go through them all.
View blog.php
<?php $n=0; foreach($page->children()->visible()->flip() as $article): $n++; ?>
<?php if($n==1): ?>
<!-- html for your first article -->
<?php else: ?>
<!-- html for all the other articles -->
<?php endif ?>
<?php endforeach ?>