Skip to content

Instantly share code, notes, and snippets.

Avatar
🖤
Working from home

Christopher Boutillé starckio

🖤
Working from home
View GitHub Profile
@starckio
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
fields:
title:
label: Page
type: text
width: 1/4
subtitle:
label: Title
type: text
View or.php
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>">
View submodules
git submodule add https://github.com/getkirby/kirby.git
git submodule add https://github.com/getkirby/panel.git
git submodule update --init --recursive
View blog.php
<?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 ?>