Title: HubL Syntax Error: Missing end tags for module_block / module_attribute / raw when saving tem

Where:

  • Theme: Helpful Hero CLEAN-6-1 (marketplace)
  • File type: (I’m not sure if this is a page template vs DnD template vs layout)
  • File path: [paste the theme file path only, no company name]

Errors (exact):

  1. Syntax error in ‘{% module_block module “widget_72ae968b-8e89-4725-8e07-2f22ff916b1d” %}’: Missing end tag: end_module_block
  2. Syntax error in ‘{% module_attribute “tab” is_json=“true” %}’: Missing end tag: end_module_attribute
  3. Syntax error in ‘{% raw %}’: Missing end tag: endraw

What I’m trying to do:
Create an aggregated listing page that pulls posts from two blogs and filters them (type toggle + dropdowns + pagination). The template includes {% extends “…/base.html” %} and {% block body %}…{% endblock %}.

Suspicion / question:
It looks like a DnD/widget wrapper (module_block / module_attribute / raw) is being injected or is left open, and then everything after it fails to parse.

  • Is it valid to place a page template (with {% extends %}) inside a DnD template/layout?
  • Where should endraw, end_module_attribute, and end_module_block be closed in this situation?
  • What’s the correct file type / structure to use for a custom page template in this theme?

Relevant snippet (top of file):

{% module_block module “widget_72ae968b-8e89-4725-8e07-2f22ff916b1d” %} {% module_attribute “tab” is_json=“true” %} {% raw %} … content …

Relevant snippet (bottom of file):

… end of file …

Any guidance on the correct structure (DnD vs page template) and where those end tags should live would be appreciated.

Hi @LautaroGriguelo

Thanks for your post!

I want to share with you two community threads that offers help to solve your issue: https://community.hubspot.com/t5/CMS-Development/Help-with-understanding-docs-for-module-block/m-p/724361

https://community.hubspot.com/t5/CMS-Development/modules-are-not-shown/m-p/837410#:~:text=are%20not%20shown-,SOLVE,Hope%20this%20helps.

Also I’m tagging a few community subject matter experts that can offer more insights. Hello there @evaldas @MichaelMa @alyssamwilie Hope you’re having a great day! Any ideas for this issue? Thanks!

Victor

We would need to see how the full template is laid out to better debug the issue, but as to your questions:

  • The extend would usually be at the top of the templte, outside the dnd_area and your dnd_area within the designated blocks aka {% block body %}{% endblock %}
  • They should close wherever the content inside them ends. Not enough information is really provided about how this is being inserted to provide an in depth answer.
    • I am wondering though what {% raw %} is being used for in this instance? {% raw %} {% endraw %} outputs all HubL inside it as plain text. So if any of your HubL code is inside it it is not being rendered.
    • Also is this being placed inside a dnd_area? Because you have to use dnd elements when inside a dnd_area. Drag and Drop areas overview - HubSpot docs
  • Template files are always .html files, as for the structure this can vary a bit from theme to theme so you would need to look at one of the ready made templates in the theme for reference.