CMS Development

cory-blackbird
Participante

dnd_module divider width

resolver

Maybe I'm missing something here, but I've added the "@hubspot/divider" to a template as a `dnd_module`. It works fine, except I can't actually use the `width` parameter, because the `width` parameter of a `dnd_module` corresponds to the column width (1–12). Is there a way to get at the underlying module's `width` parameter when using it as a `dnd_module`?

 

{% dnd_section %}
  {% dnd_row %}
    {% dnd_module path="@hubspot/divider",
      width=100 # does not work
    %}
    {% end_dnd_module %}
  {% end_dnd_row %}
{% end_dnd_section %}

 

Are there other module property overlaps with dnd_module-specific parameters?

0 Avaliação positiva
1 Solução aceita
jmclaren
Solução
HubSpot Employee
HubSpot Employee

dnd_module divider width

resolver

Hey there, we recently discovered this issue.

The solution for now is that we've added a fields parameter. For any situations where a dnd_area style parameter is the same as a module field you would be able to use this. Thankfully, this is pretty rare. 

{% dnd_area "main_content"%}
     {% dnd_section %}
        {% dnd_column %}
          {% dnd_row %}
            {% dnd_module path="@hubspot/divider",
               fields={width: "90"}
            %}
            {% end_dnd_module %}
        {% end_dnd_row %}
      {%end_dnd_column%}
    {% end_dnd_section %}
  {% end_dnd_area %}

This obviously isn't the long term solution but it's not as simple on our end as just updating the module. Doing so would break websites that are not using the module within a dnd_area. Because when it's not in a dnd_area width works as you expect.

Thank you for reporting, and sorry this issue occured. We're thinking through more permanent solutions. Understand though when I say that, I'm not meaning that the fields parameter is temporary. It will be sticking around so feel free to use it.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

Exibir solução no post original

5 Respostas 5
jmclaren
Solução
HubSpot Employee
HubSpot Employee

dnd_module divider width

resolver

Hey there, we recently discovered this issue.

The solution for now is that we've added a fields parameter. For any situations where a dnd_area style parameter is the same as a module field you would be able to use this. Thankfully, this is pretty rare. 

{% dnd_area "main_content"%}
     {% dnd_section %}
        {% dnd_column %}
          {% dnd_row %}
            {% dnd_module path="@hubspot/divider",
               fields={width: "90"}
            %}
            {% end_dnd_module %}
        {% end_dnd_row %}
      {%end_dnd_column%}
    {% end_dnd_section %}
  {% end_dnd_area %}

This obviously isn't the long term solution but it's not as simple on our end as just updating the module. Doing so would break websites that are not using the module within a dnd_area. Because when it's not in a dnd_area width works as you expect.

Thank you for reporting, and sorry this issue occured. We're thinking through more permanent solutions. Understand though when I say that, I'm not meaning that the fields parameter is temporary. It will be sticking around so feel free to use it.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

cory-blackbird
Participante

dnd_module divider width

resolver

Thanks @jmclaren! The fields parameter makes a lot of sense in this context. I may end up using it more often than not to separate what are parameters for the dnd layout vs the underlying module.

alyssamwilie
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

dnd_module divider width

resolver

@cory-blackbird This is an issue I've brought up in the Hubspot slack that they're hopefully going to look into fixing. In the meantime you would need to clone the module and change the name of the width field to be able to use it and set a width. I haven't run into any other modules with an issue like this, so hopefully it's just the one.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

dnd_module divider width

resolver
Hey @alyssamwilie,
Could you send me a link to that slack thread?
0 Avaliação positiva
alyssamwilie
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

dnd_module divider width

resolver

https://hubspotdev.slack.com/archives/CFPRTEGTX/p1610118824371500

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.