Skip to content

Commit 1fd5c0b

Browse files
committed
Added support of classes on shortcode numbers getgrav#19
1 parent c6301f7 commit 1fd5c0b

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v2.2.4
2+
## 04/xx/2017
3+
4+
1. [](#improved)
5+
* Added the ability to set `class=""` on the `ui-callout` shortcode [#19](https://github.com/getgrav/grav-plugin-shortcode-ui/pull/19)
6+
17
# v2.2.3
28
## 03/04/2017
39

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ The `[ui-callout-item]` shortcode that defines each item has the following param
172172

173173
You can use whatever markdown you wish in the item itself. These will be represented as tooltips on hover.
174174

175+
You can also combine this shortcode with [Animate.css](https://daneden.github.io/animate.css/) by including the CSS class in your theme or page, and then adding top-level class entries:
176+
177+
```
178+
[ui-callout class="pulse infinite animated"]
179+
...
180+
[/ui-callout]
181+
```
182+
175183
#### Image Compare
176184

177185
This shortcode takes two images and provides a simple way to compare them via a draggable handle that lets you slide one image over the other.

shortcodes/CalloutShortcode.php

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function init()
2222
$output = $this->twig->processTemplate('partials/ui-callouts.html.twig', [
2323
'hash' => $hash,
2424
'shortcode' => $sc,
25+
'classes' => $sc->getParameter('class'),
2526
'callouts' => $this->shortcode->getStates($hash),
2627
]);
2728

templates/partials/ui-callouts.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% set position = shortcodeui_parsePosition(callout.getParameter('position')) %}
77
{% set content = '<div class="tooltip-header"><h4>'~callout.getParameter('title')~'</h4></div><div class="tooltip-content">'~callout.getContent()|trim~'</div>' %}
88
<div class="callout-item" data-tooltip="{{ content|e('html_attr') }}" data-tooltip-color="white" style="{{ position.location }}">
9-
<div class="callout-marker callout-coords-{{ position.coords }}">{{ loop.index }}</div>
9+
<div class="callout-marker callout-coords-{{ position.coords }} {{ classes }}">{{ loop.index }}</div>
1010
</div>
1111
{% endfor %}
1212
</div>

0 commit comments

Comments
 (0)