From 17bbae1782c42ff2f0c388ae1315fb87649aab4b Mon Sep 17 00:00:00 2001 From: plantlover Date: Fri, 23 Dec 2016 14:12:06 +0100 Subject: [PATCH 1/4] Bootstrap carousel: Add images_path attribute --- shortcodes/Bootstrap/CarouselShortcode.php | 1 + templates/bootstrap/carousel.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shortcodes/Bootstrap/CarouselShortcode.php b/shortcodes/Bootstrap/CarouselShortcode.php index 4a408aa..05b7f0b 100644 --- a/shortcodes/Bootstrap/CarouselShortcode.php +++ b/shortcodes/Bootstrap/CarouselShortcode.php @@ -76,6 +76,7 @@ protected function renderOutput(ShortcodeInterface $shortcode) return $this->twig->processTemplate($this->template(), [ 'id' => $shortcode->getParameter('id'), 'name' => $shortcode->getParameter('name'), + 'images_path' => $shortcode->getParameter('images_path'), 'previous_label' => $this->defaultValue($shortcode->getParameter('previous_label'), 'Previous'), 'next_label' => $this->defaultValue($shortcode->getParameter('next_label'), 'Next'), 'items' => $this->shortcode->getStates($this->shortcode->getId($shortcode)), diff --git a/templates/bootstrap/carousel.html.twig b/templates/bootstrap/carousel.html.twig index 3044a69..0a7a1db 100644 --- a/templates/bootstrap/carousel.html.twig +++ b/templates/bootstrap/carousel.html.twig @@ -14,8 +14,8 @@ 'caption': item.content|trim, } %} {% endif %} -
- {{ grav.page.find('/images').media.images[values.image] }} +
+ {{ grav.page.find(images_path).media.images[values.image] }}
{% endfor %} From ea1e7c963b880e5041c95a0d989e334c6541b397 Mon Sep 17 00:00:00 2001 From: plantlover Date: Fri, 23 Dec 2016 14:14:02 +0100 Subject: [PATCH 2/4] Revert "Bootstrap carousel: Add images_path attribute" This reverts commit 17bbae1782c42ff2f0c388ae1315fb87649aab4b. --- shortcodes/Bootstrap/CarouselShortcode.php | 1 - templates/bootstrap/carousel.html.twig | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/shortcodes/Bootstrap/CarouselShortcode.php b/shortcodes/Bootstrap/CarouselShortcode.php index 05b7f0b..4a408aa 100644 --- a/shortcodes/Bootstrap/CarouselShortcode.php +++ b/shortcodes/Bootstrap/CarouselShortcode.php @@ -76,7 +76,6 @@ protected function renderOutput(ShortcodeInterface $shortcode) return $this->twig->processTemplate($this->template(), [ 'id' => $shortcode->getParameter('id'), 'name' => $shortcode->getParameter('name'), - 'images_path' => $shortcode->getParameter('images_path'), 'previous_label' => $this->defaultValue($shortcode->getParameter('previous_label'), 'Previous'), 'next_label' => $this->defaultValue($shortcode->getParameter('next_label'), 'Next'), 'items' => $this->shortcode->getStates($this->shortcode->getId($shortcode)), diff --git a/templates/bootstrap/carousel.html.twig b/templates/bootstrap/carousel.html.twig index 0a7a1db..3044a69 100644 --- a/templates/bootstrap/carousel.html.twig +++ b/templates/bootstrap/carousel.html.twig @@ -14,8 +14,8 @@ 'caption': item.content|trim, } %} {% endif %} -
- {{ grav.page.find(images_path).media.images[values.image] }} +
+ {{ grav.page.find('/images').media.images[values.image] }}
{% endfor %} From 5d5123669ed6c1fc6363942bce6e72c702065d33 Mon Sep 17 00:00:00 2001 From: ehb Date: Fri, 23 Dec 2016 14:19:19 +0100 Subject: [PATCH 3/4] Bootstrap carousel: Add images_path attribute --- shortcodes/Bootstrap/CarouselShortcode.php | 1 + templates/bootstrap/carousel.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shortcodes/Bootstrap/CarouselShortcode.php b/shortcodes/Bootstrap/CarouselShortcode.php index 4a408aa..05b7f0b 100644 --- a/shortcodes/Bootstrap/CarouselShortcode.php +++ b/shortcodes/Bootstrap/CarouselShortcode.php @@ -76,6 +76,7 @@ protected function renderOutput(ShortcodeInterface $shortcode) return $this->twig->processTemplate($this->template(), [ 'id' => $shortcode->getParameter('id'), 'name' => $shortcode->getParameter('name'), + 'images_path' => $shortcode->getParameter('images_path'), 'previous_label' => $this->defaultValue($shortcode->getParameter('previous_label'), 'Previous'), 'next_label' => $this->defaultValue($shortcode->getParameter('next_label'), 'Next'), 'items' => $this->shortcode->getStates($this->shortcode->getId($shortcode)), diff --git a/templates/bootstrap/carousel.html.twig b/templates/bootstrap/carousel.html.twig index 3044a69..0a7a1db 100644 --- a/templates/bootstrap/carousel.html.twig +++ b/templates/bootstrap/carousel.html.twig @@ -14,8 +14,8 @@ 'caption': item.content|trim, } %} {% endif %} -
- {{ grav.page.find('/images').media.images[values.image] }} +
+ {{ grav.page.find(images_path).media.images[values.image] }}
{% endfor %} From 4637e6bda8dd388f08908f7f42304b3a8b3e1758 Mon Sep 17 00:00:00 2001 From: ehb Date: Fri, 23 Dec 2016 14:33:13 +0100 Subject: [PATCH 4/4] README.md: Fix typo and links --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 788806b..bd741d1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Gravstrap Plugin +`Gravstrap` is a [Grav](http://github.com/getgrav/grav) plugin that provides Bootstrap components as shortcodes. +A shortcode is defined by a simple structure and it is added to a Grav page to render a full component like a simple button, +or a more complex one like a carousel or a navbar, till a full complex module, like a portfolio. -`Gravstrap` is a [Grav](http://github.com/getgrav/grav) plugin that provides Bootstrap components as shortcodes. A shortcode is defined by a simple structure and it is added to a Grav page to render a full component like a simple button, or a more complex one like a carousel or a navbar, till a full complex module, like a portfolio. - -The full ducumentation is available at the [developer's website](http://diblas.net/plugins/use-bootstrap-components-as-shortcodes-in-grav-cms) +# Documentation +The full documentation is available at the [developer's website](http://diblas.net/plugins/gravstrap#documentation)