From 64cb550e9fc439d33c186a10a2e3cc18aadf069d Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Fri, 15 Apr 2016 22:53:09 +0200 Subject: [PATCH] [SITE] activate js files in html-end separately for each template --- site/config/config.php | 5 --- site/snippets/base/html-end.php | 63 +++++++++++++++++++-------------- site/templates/default.php | 3 +- site/templates/home.php | 3 +- site/templates/photo.php | 5 ++- site/templates/project.php | 5 ++- site/templates/projects.php | 3 +- site/templates/webdesign.php | 3 +- 8 files changed, 52 insertions(+), 38 deletions(-) diff --git a/site/config/config.php b/site/config/config.php index c08cc5d..bf52584 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -43,11 +43,6 @@ c::set('plg_masonry.sort', 'sort'); // sortBy parameter: sort, title, etc. c::set('plg_masonry.dir', 'asc'); // sortBy direction: asc, desc c::set('plg_masonry.lightbox', 'swipebox'); -// plg-navbar style: -//c::set('navbar-class', 'navbar-inverse navbar-fixed-top'); -//c::set('navbar-ignoreChildren', true); -//c::set('navbar-affix', true); - // bastians columns.php plugin from https://github.com/getkirby/plugins/tree/master/columns c::set('columns.container', 'row'); c::set('columns.item', 'col-sm-6 columns'); diff --git a/site/snippets/base/html-end.php b/site/snippets/base/html-end.php index f904123..7facfef 100644 --- a/site/snippets/base/html-end.php +++ b/site/snippets/base/html-end.php @@ -4,44 +4,44 @@ // copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de // license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License + +// set switches, to enable parts of the code. All disabled by default! // ------------------------------------------- + +// available switches: +$switches = array("bs_util", "bs_collapse", "bs_carousel", "plg_masonry"); +$jquery = false; + +foreach ($switches as $switch) { + if (isset(${$switch}) && ${$switch}==true) { + $jquery = true; + ${$switch} = true; + }else { + ${$switch} = false; + } +} ?> + + - - - - + + - - - - - - - - - + + + + + diff --git a/site/templates/default.php b/site/templates/default.php index b510685..17ce428 100644 --- a/site/templates/default.php +++ b/site/templates/default.php @@ -21,4 +21,5 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1]) ?> diff --git a/site/templates/home.php b/site/templates/home.php index ee0ea93..6473694 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -24,4 +24,5 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1]) ?> diff --git a/site/templates/photo.php b/site/templates/photo.php index 020c2f5..9a47119 100644 --- a/site/templates/photo.php +++ b/site/templates/photo.php @@ -27,4 +27,7 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1, + "bs_carousel"=>1, + "plg_masonry"=>1]) ?> diff --git a/site/templates/project.php b/site/templates/project.php index 0e5d9e1..bc99760 100644 --- a/site/templates/project.php +++ b/site/templates/project.php @@ -24,4 +24,7 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1, + "bs_carousel"=>0, + "plg_masonry"=>1]) ?> diff --git a/site/templates/projects.php b/site/templates/projects.php index e8ef6f9..9a31c48 100644 --- a/site/templates/projects.php +++ b/site/templates/projects.php @@ -39,4 +39,5 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1]) ?> diff --git a/site/templates/webdesign.php b/site/templates/webdesign.php index fc91e9a..263bff5 100644 --- a/site/templates/webdesign.php +++ b/site/templates/webdesign.php @@ -33,4 +33,5 @@ snippet('base/cont-header'); - +1, + "bs_collapse"=>1]) ?>