Hi there,
is it possible to get access with Hubl to the content from all modules in a dnd-area? All my modules are custom and have a headline + anchor. My goal is to automatically generate an inpage navigation for those modules. I can do this with javascript, but I would prefer a solution with Hubl.
Thanx and BR
TJ
@TJrising As far as I know they don’t have any official variable for pulling dnd module information. BUT (I haven’t thoroughly tested this) looking through {{ content|pprint }} I think you could get your module ids through the following HubL configuration (change main_content to the name you used for your dnd_area and change section_id to the name of the field your using for the anchors):
{% set sections = content.layoutSections.main_content.rows %}
{% for columns in sections %}
{% for rows in columns %}
{% for row in rows %}
{{ row.params.section_id }}
{% endfor %}
{% endfor %}
{% endfor %}
However just wanna note that if HubSpot ever changes how this information is labeled/listed in content then this code would break.
@alyssamwilieThank you so much. This is exactly what I wanted. And thanks for the hint, that this is not official. So I will discuss this with my team.