CMS Development

WGwardjak
Contributor

Dnd area causing modules disappear

SOLVE

Hello,

my client wants to be able to add more modules to Blog Post and Blog Listing templates after clicking "Edit".

I added dnd_area to my template, but my custom modules disappeared because of that. 

What might be the possible problem?
I did that in another project and it worked - customer was able to add more modules.area.PNGdnd area.PNGmodules.PNG

0 Upvotes
1 Accepted solution
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Dnd area causing modules disappear

SOLVE

Hi @WGwardjak ,

You have to follow the proper sequence then only dnd area will work also you have to define a different unique class for your every dnd area , through which you can give css as per your requirement  as shown in below example 

 

<!-----------------------------Homepage Blog Section Start Here ----------------------------->

  

   {% dnd_area 'home-blog-module' class=’home-blog-section', label='Blog Section' %}

   {% dnd_section

    padding={

    'default': { 'top': '100', 'bottom': '100', 'right': '20', 'left': '20' }, 

    'mobile': { 'top':'60', 'bottom': '60', 'right': '20', 'left': '20' }       

    },

    max_width=1170

  %}

    {% dnd_column %}

      {% dnd_row  %}     

        {% dnd_module path='../modules/CarouselNew.module',label="CarouselNew Module" %}

          

        {% end_dnd_module %}

      {% end_dnd_row %}   

    {% end_dnd_column %}

  {% end_dnd_section %}    

{% end_dnd_area %}

 

<!----------------------------- Homepagel Blog Section Ends Here -----------------------------> 

 

<!-----------------------------Homepage other Section Start Here ----------------------------->

  

   {% dnd_area 'home-other-module' class=’home-other-section', label='Other Section' %}

  {% dnd_section

………

{% end_dnd_section %}    

{% end_dnd_area %}

 

<!----------------------------- Homepagel Other Section Ends Here -----------------------------> 

 

For More details please read this article:- https://developers.hubspot.com/docs/cms/hubl/tags/dnd-areas

Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regard.

View solution in original post

5 Replies 5
WGwardjak
Contributor

Dnd area causing modules disappear

SOLVE

Thank you all for your contribution! @webdew response was the solution!

If there is anything I can do for you - let me know 🙂 

 

0 Upvotes
MiaSrebrnjak
Community Manager
Community Manager

Dnd area causing modules disappear

SOLVE

Hi @WGwardjak,

 

Thank you for reaching out to the Community! I've moved this to our CMS board to make sure it gets seen by the right experts, I hope you don't mind. 

I noticed that you've also posted your question in a comment under this Community post, I'll leave it here for additional context. 

 

I want to tag a couple of experts to see if they can help out here: 

hi @alyssamwilie@Anton@prosa@albertsg, do you have any tips for @WGwardjak? Thank you! 

 

*EDIT: I've just seen you posted your question in the CMS board as well and already got help by the wonderful @webdew and @Oezcan. I'll merge these two posts to avoid duplicate content. 

 

Cheers
Mia, Community Team   


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings

webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Dnd area causing modules disappear

SOLVE

Hi @WGwardjak ,

You have to follow the proper sequence then only dnd area will work also you have to define a different unique class for your every dnd area , through which you can give css as per your requirement  as shown in below example 

 

<!-----------------------------Homepage Blog Section Start Here ----------------------------->

  

   {% dnd_area 'home-blog-module' class=’home-blog-section', label='Blog Section' %}

   {% dnd_section

    padding={

    'default': { 'top': '100', 'bottom': '100', 'right': '20', 'left': '20' }, 

    'mobile': { 'top':'60', 'bottom': '60', 'right': '20', 'left': '20' }       

    },

    max_width=1170

  %}

    {% dnd_column %}

      {% dnd_row  %}     

        {% dnd_module path='../modules/CarouselNew.module',label="CarouselNew Module" %}

          

        {% end_dnd_module %}

      {% end_dnd_row %}   

    {% end_dnd_column %}

  {% end_dnd_section %}    

{% end_dnd_area %}

 

<!----------------------------- Homepagel Blog Section Ends Here -----------------------------> 

 

<!-----------------------------Homepage other Section Start Here ----------------------------->

  

   {% dnd_area 'home-other-module' class=’home-other-section', label='Other Section' %}

  {% dnd_section

………

{% end_dnd_section %}    

{% end_dnd_area %}

 

<!----------------------------- Homepagel Other Section Ends Here -----------------------------> 

 

For More details please read this article:- https://developers.hubspot.com/docs/cms/hubl/tags/dnd-areas

Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regard.

Oezcan
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Dnd area causing modules disappear

SOLVE

Hello @WGwardjak ,

 

Can you please show us your code?

 

Best regards,

Özcan

Oezcan Eser Signature
Anton
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Dnd area causing modules disappear

SOLVE

Hi @WGwardjak

first of all:

- there is unfortunatly no drag&drop" for blog posts for now - but you can upvote this in the ideas board.

 

To get things right: 
unless the client edit the template your custom module gets displayed. As soon as the client edits it - it disappears. Right? Do those projects/clients have different "software"? Like does project A has CMS Hub Pro and project B only Marketing Hub Pro. Things like this. I've came accross some similar behavior in the past. 

 

Also: there are few things that you shouold check/do:

  1. change {% module_block %}... {% end_module_block %} to {% dnd_module %}...{% end_dnd_module %} for all modules that are inside of the dnd_area
  2. If your module shouldn't be removable - place it outside of the dnd_area
  3. check if your module(s) is/are enabled for blog listing

 

 

hope this helps, 

 

best

Anton

Anton Bujanowski Signature