Skip to content

Commit

Permalink
[CODE] BREAKING CHANGES: config options renamed, new version number
Browse files Browse the repository at this point in the history
* config options according to the standard
* cleanup code format
* v2.0 to reflect the breaking changes and incompatibility with Kirby 2
  • Loading branch information
jbeyerstedt committed Apr 14, 2019
1 parent 6dba01e commit baac6f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/

Kirby::plugin('jbeyerstedt/quote', [
'options' => [
'default_style' => 'none'
],
'tags' => [
'quote' => [
'attr' => [
Expand All @@ -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 .= '<blockquote class="' . $class . '">';


$class_p = '';
if ($tag->option('quote.default_style', 'none') == 'bs') {
if ($tag->option('jbeyerstedt.quote.default_style') == 'bs') {
$class_p .= ' mb-0';
}
$html .= '<p class="' . $class_p . '">'. $tag->value .'</p>';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jbeyerstedt/quote",
"description": "Kirbytag for (twitter bootstrap) blockquotes",
"author": "Jannik Beyerstedt <[email protected]>",
"version": "1.0.0",
"version": "2.0.0",
"license": "GNU GPLv3",
"autoload": {
"files": ["config.php"],
Expand Down

0 comments on commit baac6f9

Please sign in to comment.