This file contains 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 | |
// Tested with Shopkit 1.0.5. This template may break in future releases. | |
// Save this file as /site/templates/product.php to override the default Product template included with Shopkit. | |
snippet('header') ?> | |
<?php snippet('breadcrumb') ?> | |
<?php if ($page->hasImages()) snippet('slider',['photos'=>$page->images()]) ?> | |
<?php if ($page->brand()->isNotempty()) { ?> |
This file contains 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
/* Better drag-and-drop UI for panel files */ | |
.marginalia[href="#upload"] { | |
padding: 1rem 1rem 1rem 4rem; | |
position: relative; | |
display: block; | |
border: 2px dashed lightgrey; | |
border-radius: 0.3em; | |
} | |
html[lang="en"] .marginalia[href="#upload"]:after { | |
content: '. Drag & drop here to upload.'; |
This file contains 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 | |
// Copy this code into your config.php file | |
// Replace the default $maxDimension to meet your needs | |
// Read more about Kirby's Panel hooks at https://getkirby.com/docs/panel/developers/hooks | |
// Shrink large images on upload | |
kirby()->hook('panel.file.upload', 'shrinkImage'); | |
kirby()->hook('panel.file.replace', 'shrinkImage'); | |
function shrinkImage($file, $maxDimension = 1000) { |
This file contains 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
/* Vertically-centred close/minimize/fullscreen buttons */ | |
#titlebar-buttonbox-container { | |
margin-top: 7px !important; | |
} | |
/* Move tabs to top edge of window */ | |
#TabsToolbar { | |
margin: -16px 0 0 !important; | |
padding: 0 !important; | |
height: 30px !important; |
This file contains 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
RewriteEngine On | |
RewriteBase / | |
# http://shopzest.com => https://shopzest.com | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} ^shopzest\.com | |
RewriteRule ^(.*)$ https://shopzest.com/$1 [R=301,L] | |
# http://www.shopzest.com => https://shopzest.com | |
# https://www.shopzest.com => https://shopzest.com |
This file contains 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 | |
kirbytext::$tags['gfycat'] = array( | |
'html' => function($tag) { | |
$gfyID = $tag->attr('gfycat'); | |
return '<video poster="//thumbs.gfycat.com/'.$gfyID.'-poster.jpg" loop autoplay mute> | |
<source id="webmsource" type="video/webm" src="//zippy.gfycat.com/'.$gfyID.'.webm"></source> | |
<source id="mp4source" type="video/mp4" src="//fat.gfycat.com/'.$gfyID.'.mp4"></source> | |
<img src="//giant.gfycat.com/'.$gfyID.'.gif"></img> |
This file contains 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 | |
function get_cart() { | |
s::start(); | |
$cart = s::get('cart', array()); | |
return $cart; | |
} | |
function cart_logic($cart) { | |
if (isset($_REQUEST['action'])) { |
This file contains 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 | |
/** | |
Translates Kirby's index() function to a nested list by building a string of markdown text then converting it to HTML. Useful for navigation menus of unknown depth. | |
@param must be an index() object | |
@return string of HTML | |
*/ | |
function showIndex($pages) { | |
// Initialize output string |