Skip to content

Instantly share code, notes, and snippets.

View niklausgerber's full-sized avatar
🍪

Niklaus Gerber niklausgerber

🍪
View GitHub Profile
<?php if($page->hasPrev()): ?>
« <a href="<?php echo $page->prev()->url() ?>">Previous</a>
<?php endif ?>
| //Separator: Should only show up between "Previous | Next" but not if there is just one.
<?php if($page->hasNext()): ?>
<a href="<?php echo $page->next()->url() ?>">Next</a> »
<?php endif ?>
@niklausgerber
niklausgerber / home.php
Created February 28, 2012 09:42
Show articles on home but not on blog page / different folder
<?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 ?>
Title: Your Title
----
Background: #ececec
----
Background-Banner: #ffffff
/*
###### ###### ### ## ########
## ## ## ## ## ## ## ##
## ## ## ## ## ##
###### ## ## ## ## ######
## ## ######### ## ##
## ## ## ## ## ## ## ##
###### ###### ## ## ######## ########
Short URL: http://scalecss.com
Let's say I have 30 items then the scrubber will move off screen. How can I manage that out of the amount of object it is calculated how far the scrubber moves - the more items the shorter is the distance the scrubber moves every time? This means the scrubber starts always at left end ends at right - how many items I would have.
@niklausgerber
niklausgerber / gist:1647196
Created January 20, 2012 12:39
Protect kirby pages
# The Snippet
<?php
// getting the username and password
$LOGIN_INFORMATION = array(
(string)$page->benutzernamen() => $page->passwort()
// 'user' => 'password',
);
@niklausgerber
niklausgerber / gist:1620782
Created January 16, 2012 13:07
Problem with Variables
I would like to change this
$LOGIN_INFORMATION = array(
'username' => 'password'
);
into this
$LOGIN_INFORMATION = array(
$page->username() => $page->password()