CMS Development

cory-blackbird
参加者

dnd_module divider width

解決

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 いいね!
1件の承認済みベストアンサー
jmclaren
解決策
HubSpot Employee
HubSpot Employee

dnd_module divider width

解決

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.

元の投稿で解決策を見る

5件の返信
jmclaren
解決策
HubSpot Employee
HubSpot Employee

dnd_module divider width

解決

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
参加者

dnd_module divider width

解決

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
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

dnd_module divider width

解決

@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
HubSpot製品開発チーム
HubSpot製品開発チーム

dnd_module divider width

解決
Hey @alyssamwilie,
Could you send me a link to that slack thread?
0 いいね!
alyssamwilie
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

dnd_module divider width

解決

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.