From baac6f95ff9956bca0da54e6f04a8eed59d58086 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Sun, 14 Apr 2019 13:16:32 +0200 Subject: [PATCH] [CODE] BREAKING CHANGES: config options renamed, new version number * config options according to the standard * cleanup code format * v2.0 to reflect the breaking changes and incompatibility with Kirby 2 --- README.md | 7 +++++-- index.php | 7 +++++-- package.json | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index beabe60..179f228 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,15 @@ by Jannik Beyerstedt from Hamburg, Germany [jannikbeyerstedt.de](http://jannikbeyerstedt.de) | [Github](https://github.com/jbeyerstedt) **license:** GNU GPL v3 -**version:** v1.0.0 +**version:** v2.0.0 ## Notice About Branches and Kirby 2 Kirby 3 support was added in the `kirby3` branch, because Kirby 2 and Kirby 3 plugins are quite different. Now that Kirby 3 is released, I changed the default branch to `kirby3` but will keep the `master`, because old Kirby 2 projects might break, if I rename the branches. +**Updating from the Kirby 2 version:** The configuration options are now prefixed by `jbeyerstedt.quote` instead of `quote`. +This is caused by the new way, how plugins work within Kirby 3. + ## Introduction This Kirbytag creates a html `blockquote` tag with the option to add an author via a footer tag. @@ -33,7 +36,7 @@ composer require jbeyerstedt/quote To enable the styling classes used by Bootstrap 4, add this to your `config.php`: ```php -c::set('quote.default_style', 'bs'); +c::set('jbeyerstedt.quote.default_style', 'bs'); ``` #### Usage diff --git a/index.php b/index.php index 592875f..f9117ed 100755 --- a/index.php +++ b/index.php @@ -8,6 +8,9 @@ */ Kirby::plugin('jbeyerstedt/quote', [ + 'options' => [ + 'default_style' => 'none' + ], 'tags' => [ 'quote' => [ 'attr' => [ @@ -19,14 +22,14 @@ $html = ''; $class = $tag->class; - if ($tag->option('quote.default_style', 'none') == 'bs') { + if ($tag->option('jbeyerstedt.quote.default_style') == 'bs') { $class .= ' blockquote'; } $html .= '
'; $class_p = ''; - if ($tag->option('quote.default_style', 'none') == 'bs') { + if ($tag->option('jbeyerstedt.quote.default_style') == 'bs') { $class_p .= ' mb-0'; } $html .= '

'. $tag->value .'

'; diff --git a/package.json b/package.json index 8b3a479..f157f8f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jbeyerstedt/quote", "description": "Kirbytag for (twitter bootstrap) blockquotes", "author": "Jannik Beyerstedt ", - "version": "1.0.0", + "version": "2.0.0", "license": "GNU GPLv3", "autoload": { "files": ["config.php"],