dnd_module divider width

SOLVE
cory-blackbird
Participant

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 Upvotes
1 Accepted solution

Accepted Solutions
jmclaren
Solution
HubSpot Employee

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

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

View solution in original post

5 Replies 5
amwilie
Key Advisor | Elite Partner

@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.

border

Alyssa Wilie

Web Developer at LyntonWeb

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

dennisedson
Community Manager
Hey @amwilie,
Could you send me a link to that slack thread?
Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
amwilie
Key Advisor | Elite Partner

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

border

Alyssa Wilie

Web Developer at LyntonWeb

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

jmclaren
Solution
HubSpot Employee

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

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

View solution in original post

cory-blackbird
Participant

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.