render an entire module after export_to_template_context=True
lösung
I want to export to template environment as a way to queue up a module without it being displayed, and then only render the module if there is content to display. Any way to do this? is export_to_template_context the wrong idea?
render an entire module after export_to_template_context=True
lösung
I answered my own question
I needed to call the module again, in this case it was a {% gallery %}
I wrote an if statement to render the gallery ONLY if there was a slide...what I found was a parameter called "slides", so writing:
{% if widget_data.gallery.slides %} {{ widget.gallery }} {% endif %}
This worked great, even though the documentation largely spoke of ".value" as the parameter used to check if a module had value. For some reason .value would not work at all. Also, "slides" is not really spoken of at all in the hubl documentation so it was a pain to figure out.
render an entire module after export_to_template_context=True
lösung
I answered my own question
I needed to call the module again, in this case it was a {% gallery %}
I wrote an if statement to render the gallery ONLY if there was a slide...what I found was a parameter called "slides", so writing:
{% if widget_data.gallery.slides %} {{ widget.gallery }} {% endif %}
This worked great, even though the documentation largely spoke of ".value" as the parameter used to check if a module had value. For some reason .value would not work at all. Also, "slides" is not really spoken of at all in the hubl documentation so it was a pain to figure out.