Many times one (you/me/them) need to load dynamically based on interaction or just async on load a list of things (a View). Might be because the list depends on conditions set on a Metadata Display with arguments, or on interaction (clicks). Writing code to do that is a bit advanced and might require rewiring some stuff. But all our users have access to editing their twig templates, so following the Bootstrap idea, let's use data- selector to give Ajax/JS commands on what can be done.
The idea is simple:
You output this:
<button id="aRequiredID"
data-sbf-view-id="creative_work_series_children"
data-sbf-view-display-id="block_1"
data-sbf-view-arguments="45"
data-sbf-view-render-target="the_target"
data-sbf-view-event="click">
Click me to load creative_work_series_children View
with block_1 display
passing argument 45
inside another DIV with a class named "js-view-dom-id-the_target"
</button>
<div class="js-view-dom-id-the_target">HERE WILL BE MY VIEW LOADED</div>
What?
Many times one (you/me/them) need to load dynamically based on interaction or just async on load a list of things (a View). Might be because the list depends on conditions set on a Metadata Display with arguments, or on interaction (clicks). Writing code to do that is a bit advanced and might require rewiring some stuff. But all our users have access to editing their twig templates, so following the Bootstrap idea, let's use
data-
selector to give Ajax/JS commands on what can be done.The idea is simple:
You output this: