While I’ve been developing a site, I created a custom menu using collapse. It works similar to how an Accordion works.
In order to show the menu, I have to manually enter the show
class in the <div>
that contains the collapse
class.
I’ve added a custom option to <div id="#exampleCollapse">
. However, I was thinking it would make more sense to place it on the <button>
and then it adds the show
class to the <div id="#exampleCollapse">
.
I’m looking to hope this can bring linking to custom options or allow a way to define custom “Accordion”, “Collapse”, “Dropdown” to certain elements and have them behave as such.
I feel like adding a “relationship” option would be helpful to the Custom Options and it links the two items together.
Such as:
“Add Relationship”
- Name: Custom Collapse
- Tooltip: “Enabled the custom collapse dropdown”
- Action: Add Class Name
- Class Name: show
- Attribute: data-bs-target
- ID: exampleCollapse
It will then link the data-bs-target and ID together.
Custom Collapse Code:
<div> <!-- Start of Custom Collapse -->
<div> <!-- Controller -->
<ul class="nav flex-column">
<li class="nav-item">
<!-- Custom Option should be added here, because this is what's selectable first. -->
<button class="nav-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#exampleCollapse">Custom Dropdown</button>
</li>
</ul>
</div>
<!-- Should add `show` to the class list from the Custom Option or "Toggle Target" from the Options Pane -->
<!-- I have added a Custom Option to this section, but it's not the first item selectable in the Stage -->
<div id="#exampleCollapse" class="collapse"> <!-- Dropdown -->
<div class="card">
<div class="card-body p-2">
<ul class="nav flex-column">
</li class="nav-item">
<a href="#" class="nav-link">Example Link</a>
</li>
</ul>
</div>
</div>
</div>
</div>