Skip to content

Instantly share code, notes, and snippets.

Avatar
🖤
Working from home

Christopher Boutillé starckio

🖤
Working from home
View GitHub Profile
View Test error message.
<?php snippet('header') ?>
<section class="content cf">
<?php if(param('tag')) {
$articles = $pages->find('blog')
->children()
->visible()
->filterBy('tags', param('tag'), ',')
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 ?>
@starckio
starckio / Reset Launchpad
Last active Aug 29, 2015
Reset Launchpad on OS X 10.10 - Yosemite
View Reset Launchpad
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
@starckio
starckio / blog.php
Last active Oct 26, 2016
Load more content
View blog.php
<?php snippet('header') ?>
<main class="main blog" role="main">
<?php $articles = $page->children()->visible()->flip()->paginate(6) ?>
<?php foreach($articles as $article): ?>
<article class="posts">
<h1><?php echo $article->title()->html() ?></h1>
<time datetime="<?php echo $article->date('c') ?>" pubdate="pubdate"><?php echo $article->date('d.m.Y H:i') ?></time>
<p><?php echo $article->text()->excerpt(300) ?></p>
@starckio
starckio / index.php
Last active Aug 29, 2015
Reducing codes css in php for Kirby CMS.
View index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><?php echo $site->title()->html() ?> | <?php echo $page->title()->html() ?></title>
<meta name="description" content="<?php echo $site->description()->html() ?>">
<meta name="keywords" content="<?php echo $site->keywords()->html() ?>">
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 submodules
git submodule add https://github.com/getkirby/kirby.git
git submodule add https://github.com/getkirby/panel.git
git submodule update --init --recursive
@starckio
starckio / donate.js
Created Oct 20, 2016
Systeme de donation PayPal - For GetKirby-Themes.com
View donate.js
function getEventTarget(e) {
e = e || window.event;
return e.target || e.srcElement;
}
function removeClass (argument) {
for (var i = argument.length - 1; i >= 0; i--) {
argument[i].className = ""
}
}
View or.php
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>">
@starckio
starckio / menu.php
Last active Mar 18, 2017
Correct - Theme Roon
View menu.php
<nav role="navigation">
<ul class="menu cf">
<?php foreach($pages->visible() as $p): ?>
<li>
<a <?php e($p->isOpen(), ' class="active"') ?> href="<?php echo $p->url() ?>"><?php echo $p->title()->html() ?></a>
</li>
<?php endforeach ?>
<?php foreach($site->languages() as $language): ?>