Create HubDB dynamic page view

Hello everyone

I try to create a template for a HubDB (overview) and the dynamic pages out of the HubDB. So how can i create a HubL Template for the HubDB dynamic page (row) view?

I tried the following code. The overview i get with “elif TableID” is working. Bu i cannot make it work that the dynamic page-urls are shown with this HubL-Template.

Thank you so much for your help

{% set tableId = 'team' %}

{% if sdfsdfds %}
<p>Here should the dynamic page content belong.</p> 
{% elif tableId %} 
<p>Here comes the hub-db overview.</p>
{% endif %} 

Hi @peesen

Thank you for reaching out

I want to tag some of our experts on this - @DanielSanchez @Kevin-C do you have any thoughts to share with @peesen on this?

Thank you!

Best

Tiphaine

Hello everyone, my script is based on the following tutorial:

I need to create an overview page with all the team-members and specific pages for each team-member. How can i do that? In the tutorial it is described how to set the the variable for “dynamic_page_hubdb_table_id”:

{% set dynamic_page_hubdb_table_id = <YOUR_HUBDB_TABLE_ID> %}

But how can i set the variable for “dynamic_page_hubdb_row” correct, so that it works in my example?

Thank you so much for your help!

@peesen For dynamic pages you do not set the IDs yourself in the template, this is set in the settings of the page using the template. Your template would only have the following to differentiate from overview and row :

{% if dynamic_page_hubdb_row %} 
 <!-- Your row code here --> 
{% elif dynamic_page_hubdb_table_id %}
 {% for row in hubdb_table_rows(dynamic_page_hubdb_table_id) %}
 <!-- Your overview code here -->
 {% endfor %}
{% endif %}

The page would need to be published with at least one row in your template for you to be able to view the row code by going to that row’s designated URL. If you’re wanting to view the template’s row code without publishing Hubspot doesn’t really have a way to do that. Only thing you could do is first build like your creating a static template pulling in a single row’s information and then add the dynamic if statement and row for loop in before publishing. So using only the following :

{% set row = hubdb_table_row(<tableId or name>, <rowId>) %}
<!-- followed by your row page code -->