I hereby claim:
- I am texnixe on github.
- I am sonjabroda (https://keybase.io/sonjabroda) on keybase.
- I have a public key whose fingerprint is C827 C112 15AF AC65 CC19 2D8A 5078 A576 776F E582
To claim this, I am signing this object:
<nav class=lang_toggle> | |
<?php | |
$langs=c::get('lang.available'); | |
$current=c::get('lang.current'); | |
foreach($langs as $lang): | |
?> | |
<span> | |
<a href="<?php echo $page->url($lang)?>"> | |
// show language names in the language of the respective languages; | |
// change second $lang to $current if you want all language names to show in the current language |
<?php | |
// store the content of the kirbytext text variable in $text | |
$text = kirbytext($page->text()); | |
// split the content of $text whenever a <!--pagebreak--> code is encountered and store in the array $pages | |
$pages = explode('<!--pagebreak-->', $text); | |
// count the number of pages in the array | |
$pageCount = count ($pages); |
Title: Title of Video | |
---- | |
Description: Description of video | |
---- | |
Duration: length in minutes | |
---- | |
Thumb: url/to/thumb/filename |
<nav class="languages" role="navigation'"> | |
<?php foreach($site->languages() as $language): ?> | |
<?php $inventory = $page->inventory(); | |
if (array_key_exists($language->code(),$inventory['content'])) :?> | |
<?php if(($site->language() !== $language)): ?> | |
<span> | |
<a href="<?php echo $page->url($language->code()) ?>"><?php echo $language->code(); ?></a> | |
</span> | |
<?php endif ?> | |
<?php endif ?> |
<?php | |
/** | |
* Move this file to /site/snippets/ and rename it video.php | |
*/ | |
// stop without videos | |
if(empty($videos)) return; | |
// set some defaults |
<?php | |
snippet('header'); | |
$tag = urldecode(param('tag')); | |
if(param('tag')) | |
$articles=$pages->visible()->filterBy('tags',$tag,',')->sortBy('date')->flip(); | |
?> | |
<main class="main"> | |
<section> | |
<h1><?php echo $page->title() . ' ' . $tag ?></h1> |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/* Usage example: | |
* $filteredPages = $page('projects')->children()->visible()->filterByStructure('structureField', array( | |
* 'field1' => $value, | |
* 'field2' => $value | |
* )); | |
*/ | |
pages::$methods['filterByStructure'] = function($pages, $field, $options) { | |
$filteredPages = $pages->filter(function($p)use($field, $options) { | |
$structureField = $p->$field()->yaml(); |
<?php | |
// page methods | |
// check if page has Parents | |
page::$methods['hasParents'] = function($page) { | |
return $page->parents()->count(); | |
}; | |
// get max nesting level of page |
<?php | |
class Indexer { | |
static $fields; | |
static $methods; | |
static $site; | |
static function get($where = null, $num = 20, $hideDeleted = true) { | |
if (!static::$site) static::$site = site(); |