CMS Development

sjay
Membro | Parceiro Diamante
Membro | Parceiro Diamante

How to remove wrapping div using HUBL

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?

0 Avaliação positiva
5 Respostas 5
Oezcan
Top colaborador(a) | Parceiro Diamante
Top colaborador(a) | Parceiro Diamante

How to remove wrapping div using HUBL

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.

 

https://www.stephanieogaygarcia.com/hubspot-website-development/remove-the-wrapper-from-a-field-in-a...

 

Is it still relevant @Stephanie-OG ?

Oezcan Eser Signature
Stephanie-OG
Conselheiro(a) de destaque

How to remove wrapping div using HUBL

@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

Freelance HubSpot CMS Developer

Website | Contact

sjay
Membro | Parceiro Diamante
Membro | Parceiro Diamante

How to remove wrapping div using HUBL

@Stephanie-OG  / @Oezcan , Can you help me with how to write no_wrapper=true for the div tag with the syntax?

0 Avaliação positiva
sjay
Membro | Parceiro Diamante
Membro | Parceiro Diamante

How to remove wrapping div using HUBL

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 %}



 

 

0 Avaliação positiva
Oezcan
Top colaborador(a) | Parceiro Diamante
Top colaborador(a) | Parceiro Diamante

How to remove wrapping div using HUBL

@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

Oezcan Eser Signature