diff --git a/plugins/story-blocks/shortcodes/ScrollySectionShortcode.php b/plugins/story-blocks/shortcodes/ScrollySectionShortcode.php new file mode 100644 index 0000000..077829e --- /dev/null +++ b/plugins/story-blocks/shortcodes/ScrollySectionShortcode.php @@ -0,0 +1,42 @@ +shortcode->getHandlers()->add('scrolly-section', function (ShortcodeInterface $sc) { + $plugin = $this->grav['plugins']->getPlugin('story-blocks'); + $page = $plugin ? $plugin->getCurrentPage() : null; + + $imageName = $sc->getParameter('image', ''); + $alt = htmlspecialchars($sc->getParameter('alt', ''), ENT_QUOTES); + $caption = htmlspecialchars($sc->getParameter('caption', ''), ENT_QUOTES); + $content = $sc->getContent(); /* raw inner content — Scrollama JS splits on
' . $caption . '
' + : ''; + + return << + +