CMS Development

jao28
Participant

HubDB with Drag and Drop Template

Hello, 

I like the options I am able to see in HubDB but also want a front end user to be able to keep the convenience of the Drag and Drop template (instead of using a full Html & HubL template). To this extent, I can genearte some HubL modules to accomplish a similar effect but the one problem is that the template is the same for a "summary" page as it is for a "detail" page.

 

For example, in HubL I can check dynamic_page_hubdb_row to see if I am in a "detail" mode but typical drag and drop components do not allow for this check. Is there a way to apply Logic at the drag and drop grouping level? This would allow a different header for a "detail" view versus a "summary" view. Or better yet, is there a way to dynamically change templates based on a HubL condition? Look forward to your thoughts / questions.

3 Replies 3
Marcusohmy
Participant

HubDB with Drag and Drop Template

Surprised I can't find more about this.. I'm doing my first HubSpot CMS site and I want to allow the user to modify the modules and content on the detail pages for a HubDB row, but really seems like this isn't possible which is a bit dissapointing

0 Upvotes
JSenterfitt
Member | Gold Partner
Member | Gold Partner

HubDB with Drag and Drop Template

Definitely looking to continue this conversation. Have you found any other workarounds?

0 Upvotes
jao28
Participant

HubDB with Drag and Drop Template

I have found a possible middle ground. I created a summary and detail group. I use the "Wrapping HTML" option on each group (which supports HubL) with this code snippet to target the "summary" (i.e. list) view.

{% if dynamic_page_hubdb_table_id and not(dynamic_page_hubdb_row) %}
	{{ html }}
{% endif %}

Then, for the "detail" view I use this "Wrapping HTML" code snippet

{% if dynamic_page_hubdb_row %}
     {{ html }}
{% endif %}

Look forward to hearing anyone else has a different method.