Skip to content

Instantly share code, notes, and snippets.

View bastianallgeier's full-sized avatar
🎯
Focusing

Bastian Allgeier bastianallgeier

🎯
Focusing
View GitHub Profile
<?php
if(!isset($subpages)) $subpages = $site->pages()
$ignore = array(
'blog/feed',
'another/hidden/page'
);
<?php
$stream = $pages->find('events', 'blog')->children();
echo $stream
// sollte jetzt alle kinderchen von blog und events auswerfen
?>
@bastianallgeier
bastianallgeier / pagination.php
Created January 2, 2012 16:22
Search Template for Kirby
<!-- site/snippets/pagination.php -->
<nav role="pagination">
<div class="count">
<strong><?php echo $pagination->countItems() ?></strong> Results / showing <strong><?php echo $pagination->numStart() ?></strong> - <strong><?php echo $pagination->numEnd() ?></strong>
</div>
<div class="buttons">
<? if($pagination->hasPrevPage()): ?>
<a class="prev" href="<?= $pagination->prevPageURL() ?>">&lsaquo; previous</a>
@bastianallgeier
bastianallgeier / .htaccess
Created January 3, 2012 11:58
Kirby Default htaccess
DirectoryIndex index.php index.htm index.html
# disable directory listing
Options -Indexes
# rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
@bastianallgeier
bastianallgeier / dabblet.css
Created January 5, 2012 08:17
PE to use SVG as CSS background image with fallback for IE8/7/6
/**
* PE to use SVG as CSS background image with fallback for IE8/7/6
*
* Using SVG as CSS background image to display
* resolution-independent logos or icons is pretty
* awesome but does completely fail on IE8/7/6
*
* The trick:
* All three IE versions don't support rgba color values.
* By defining a rgba background color together with the
<?php
$file = $page->videos()->find($page->dateiname());
if($file) echo $file->url();
?>
<ul>
<?php foreach($pages->index() as $p): ?>
<?php if($p->promoted() != 'yes') continue; ?>
<li><?php echo $p->title() ?></li>
<?php endforeach ?>
</ul>
<?php
$blog = $pages->find('blog');
$index = $blog->children()->index();
$cloud = array();
foreach($index as $p) {
$tags = str::split((string)$p->tags());
<nav class="pagination">
<div class="count">
<strong><?php echo $pagination->countItems() ?></strong> Results / showing <strong><?php echo $pagination->numStart() ?></strong> - <strong><?php echo $pagination->numEnd() ?></strong>
</div>
<div class="buttons">
<? if($pagination->hasPrevPage()): ?>
<a class="prev" href="<?= $pagination->prevPageURL() ?>">&lsaquo; previous</a>
<? else: ?>
Title: Project Title
----
Year: 01/2011
----
Type: corporate design
----
Text: Project description
----