no_wrapper = true, not working

I have this code in a HUBL template

 {% module_block module "section_6_img" path="@hubspot/linked_image",
 label="Section 6 Image", no_wrapper=true %}

no_wrapper = true doesn’t seem to do anything, it still outputs the wrapping HTML.

I need to give a section a background image. I want the person who is editing the page, be able to control the image. via the editor, without the need to modify CSS. What is the best way to do that?

Hi @doroness,

What I do for background images that the editor can choose is write it as an inline style on the element in question (and have the choice in the module options) like:

<section class="foo bar" {% if module.bg_image.src %}style="background-image: url({{module.bg_image.src}})"{% endif %}>
 // other html
</section>

Or you can write it in a style tag:

{% if module.bg_image.src %}
<style>
 section {
 background-image: url({{module.bg_image.src}})
 }
</style>
{% endif %}

thanks @piersg
the “module” in your example - is it a default model? (e.g - image?) or a custom one?

Any idea why no_wrapper = true, not working?

Thanks!

Ah, it’s a custom one, sorry.

Is there a particular reason you want to remove wrapper? All it does is enable the functionality that when you click the module in the preview pane, the editor scrolls to that module. It doesn’t have any impact on whether the person editing has to modify CSS.