# Create HubDB dynamic page view

**URL:** <https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782>\
**Category:** CMS Development\
**Created:** [March 31, 2021, 1:09pm UTC](https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782 "2021-03-31T13:09:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peesen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/peesen/32/74736_2.png) [@peesen](https://community.hubspot.com/u/peesen)\
**Post date:** [March 31, 2021, 1:09pm UTC](https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782/1 "2021-03-31T13:09:41Z")

</div>

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

```lia-code-sample
{% 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 %} 

```

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [April 1, 2021, 11:08am UTC](https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782/2 "2021-04-01T11:08:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peesen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/peesen/32/74736_2.png) [@peesen](https://community.hubspot.com/u/peesen)\
**Post date:** [April 1, 2021, 1:00pm UTC](https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782/3 "2021-04-01T13:00:18Z")

</div>

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

> **[Build dynamic pages using HubDB - HubSpot docs](https://developers.hubspot.com/docs/cms/start-building/features/data-driven-content/hubdb/overview)**
>
> Learn how to build dynamic website pages using HubDB data.

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!_

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [April 2, 2021, 3:15am UTC](https://community.hubspot.com/t/create-hubdb-dynamic-page-view/34782/4 "2021-04-02T03:15:53Z")

</div>

@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 :

```lia-code-sample
{% 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 :

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

```
