This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kirby .htaccess | |
# rewrite rules | |
<IfModule mod_rewrite.c> | |
# enable awesome urls. i.e.: | |
# http://yourdomain.com/about-us/team | |
RewriteEngine on | |
# make sure to set the RewriteBase correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* if this script is located in your document root… */ | |
require(__DIR__ . '/kirby/bootstrap.php'); | |
if(get('params')) { | |
$articles = page('blog')->children(); | |
$sort = ($articles->count() + 1); | |
$date = date('Y-m-d'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $article = $pages->find('blog')->children()->last() ?> | |
<div class="footer"> | |
<div class="container"> | |
<div class="grid full"> | |
// Displays the latest blog article | |
<h3><?php echo html($article->title()) ?></h3> | |
<small><?php echo html($article->Published()) ?></small> | |
<p><?php echo excerpt($article->text(), 250) ?>... <a href="<?php echo html($article->url()) ?>">Continue reading</a></p> | |
</div> | |
<div class="cf"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php snippet('header') ?> | |
<?php snippet('navigation') ?> | |
<section id="search"> | |
<?php | |
$search = new search(array( | |
'searchfield' => 'q', | |
'ignore' => array('disclaimer', 'error', 'feed', 'home', 'imprint', 'sitemap', 'about'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $article = $pages->find('blog')->children()->last() ?> | |
<section> | |
<h2 class="nav-element"><a href="<?php echo html($article->url()) ?>"><?php echo html($article->title()) ?></a></h2> | |
<p><?php echo excerpt($article->text(), 300) ?> <a href="<?php echo html($article->url()) ?>">Read more</a></p> | |
</section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php snippet('header') ?> | |
<?php snippet('menu') ?> | |
<?php | |
if(param('tag')) { | |
$articles = $pages->find('blog') | |
->children() | |
->visible() | |
->filterBy('tags', param('tag'), ',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $articles = $pages->find('blog')->children()->visible()->flip()->limit(3); ?> | |
<div class="grid"> | |
<div class="row"> | |
<?php $n=0; foreach($articles as $article): ?> | |
<div class="slot-<?php echo $n . '-' . ($n+1); ?>"> | |
<div class="center"> | |
<a href="<?php echo $article->url() ?>"><?php echo thumb($article->images()->find('thumb.png'), array('width' => 400, 'height' => 300)) ?></a> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if($page->hasPrev()): ?> | |
« <a href="<?php echo $page->prev()->url() ?>">Previous</a> | |
<?php endif ?> | |
<?php if($page->hasPrev() && $page->hasNext()): ?> | |
| //Separator: Should only show up between "Previous | Next" but not if there is just one. | |
<?php endif ?> | |
<?php if($page->hasNext()): ?> | |
<a href="<?php echo $page->next()->url() ?>">Next</a> » |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php foreach($page->children()->visible()->flip() as $article): ?> | |
<li> | |
<a href="<?php echo $article->url() ?>"><?php echo html($article->title()) ?> <span><?php echo html($article->published()) ?></span></a> | |
</li> | |
<?php endforeach ?> |
NewerOlder