Skip to content
Snippets Groups Projects

Issue #3354755: Use CSS only accordion and support nested

8 files
+ 173
30
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -25,6 +25,8 @@ class AccordionShortcode extends ShortcodeBase {
$icon = isset($attributes['icon']) && $attributes['icon'] ? '<i class="' . $attributes['icon'] . '"></i> ' : '';
$attributes['class'] = $attributes['class'] ?? '';
$attributes['class'] .= " accordion-item";
$title = $attributes['title'] ?? '';
$attributes['title'] = strip_tags($title);
$id = uniqid();
$output = [
'#theme' => 'shortcode_accordion',
@@ -32,7 +34,7 @@ class AccordionShortcode extends ShortcodeBase {
'#text' => $text ,
'#id' => $id ,
'#icon' => $icon ,
'#title' => $attributes['title'],
'#title' => $title,
];
return $this->render($output);
Loading