Skip to content

Instantly share code, notes, and snippets.

View starckio's full-sized avatar
🍼
Baby boy !

Christopher Boutillé starckio

🍼
Baby boy !
View GitHub Profile
<?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 ?>
@starckio
starckio / blog.php
Last active August 29, 2015 14:24 — forked from bastianallgeier/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.
?>
git submodule add https://github.com/getkirby/kirby.git
git submodule add https://github.com/getkirby/panel.git
git submodule update --init --recursive
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>">
@starckio
starckio / blueprints--contact.yml
Last active February 8, 2019 21:56 — forked from bastianallgeier/controllers--contact.php
Plain contactform example for Kirby 2
title: Contact
pages: false
fields:
title:
label: Page
type: text
width: 1/4
subtitle:
label: Title
type: text