Bläddra i källkod

Accordion (#550)

This adds custom class and custom id to the individual panels on the
accordian block. There is an input for these while you're constructing
an accordian but the template doesn't utilize them. Tested locally and
seems to work fine.

Co-authored-by: Zachary Svoboda <zsvoboda@coderedcorp.com>
Zachary Svoboda 2 år sedan
förälder
incheckning
765401a14a
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      coderedcms/templates/coderedcms/blocks/accordion_block.html

+ 1 - 1
coderedcms/templates/coderedcms/blocks/accordion_block.html

@@ -4,7 +4,7 @@
 {% with a_id=self.accordion.id accordion=self.accordion %}
 <div class="accordion" id="accordion-{{a_id}}">
   {% for panel in accordion.accordion_panels.all %}
-  <div class="accordion-item">
+  <div id="{{panel.custom_id}}" class="accordion-item {{panel.custom_css_class}}">
     <h2 class="accordion-header" id="accordion-heading-{{forloop.counter}}">
       <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
         data-bs-target="#collapse-{{a_id}}-{{forloop.counter}}" aria-expanded="false"