We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Sep 6, 2022 3:07 AM
Hi,
How to remove the wrapping Div in HUBL
In JQuery we have $('.child_class').unwrap(); to remove parent class.
Similarly, do we have anything in HubL to remove only the div element?
Sep 6, 2022 8:27 AM
I haven't needed it yet. But look according to this article you can also use no_wrapper=true on the fields in a module.
Is it still relevant @Stephanie-OG ?
Sep 6, 2022 8:49 AM
@Oezcan - I usually use no_wrapper=true on fields, but I'm not 100% sure about modules. I think it should work too!
Stephanie O'Gay Garcia
Sep 6, 2022 10:00 AM
@Stephanie-OG / @Oezcan , Can you help me with how to write no_wrapper=true for the div tag with the syntax?
Sep 6, 2022 5:10 AM
Hi Ozcan,
The below code snippet is for the module wrapping. But I just wanted to remove a div Element using HUBL based on condition. Is that possible?
{% module "module" path="../modules/module", label="Module", no_wrapper=True %}
Sep 6, 2022 4:59 AM
@Hello @sjay
if you mean something like this:
{% module "module" path="../modules/module", label="Module", no_wrapper=True %}
you only need no_wrapper=true.
I hope this helps.
Best regards,
Özcan