# Multi Resource hubDB Table

**URL:** <https://community.hubspot.com/t/multi-resource-hubdb-table/135109>\
**Category:** CMS Development\
**Tags:** hubdb, enterprise\
**Created:** [June 24, 2025, 6:33pm UTC](https://community.hubspot.com/t/multi-resource-hubdb-table/135109 "2025-06-24T18:33:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TSwisher008](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@TSwisher008](https://community.hubspot.com/u/TSwisher008)\
**Post date:** [June 24, 2025, 6:33pm UTC](https://community.hubspot.com/t/multi-resource-hubdb-table/135109/1 "2025-06-24T18:33:16Z")

</div>

I have a hubDB database to build dynamic pages with multiple resources (analyst reports, whitepapers etc. I have a single select column "resource\_type.  
I’ve noticed that if I take the end slug from the resource and put it on the end of the [example.com/resource/](http://example.com/resource/) **whitepaper** /my-slug or /resource/ **analyst-report** /my-slug, it will render regardless because they are in the same database.  
So I have added code to ID what resource it is, but now I end up with a blank page when it isn’t the correct resource. Nav and footer, but no body. I’ve tried to do an else and force a 404, but have had no luck.  
Can someone give me some help on what the best practice would be in this situation? The code (screenshot) gives me a blank page. If I add ?hsCacheBuster=1234, it shows the 404, but I think that is because it is refreshing the page. It has been 24 hours, so I don’t think it is a caching issue.  
Thanks in advance.

 ![Screenshot 2025-06-24 at 12.30.10 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/450aa64ad326f14110f58a19c266dbb054db40e0.png)

---

<div class="post-metadata">

**Author:** ![Victor\_Becerra](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@Victor\_Becerra](https://community.hubspot.com/u/Victor_Becerra)\
**Post date:** [June 25, 2025, 3:14pm UTC](https://community.hubspot.com/t/multi-resource-hubdb-table/135109/2 "2025-06-25T15:14:31Z")

</div>

Hey @TSwisher008,

Thanks for reaching out with this! This is a common challenge when setting up dynamic pages with HubDB, especially when dealing with different resource types from a single table. Hitting that blank page is definitely frustrating.

I’m tagging a few community members who can help with this:  
@kosalaindrasiri @SteveHTM @GiantFocal  
Hopefully, they can provide some insights to help you sort this out!

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [June 26, 2025, 7:07am UTC](https://community.hubspot.com/t/multi-resource-hubdb-table/135109/3 "2025-06-26T07:07:47Z")

</div>

Hi @TSwisher008

The main problem lies in the logic where it is finding an exact page match for the slug.  
i.e. dynamic\_page\_hubdb\_row exists, but the problem is that it doesn’t match that template that it is built for, like here, it is for “whitepaper”, and the slug is for “analyst-reports”. This is why the condition fails and skips everything except nav and footer. If the dynamic\_page\_hubdb\_row exists but is not the same type, it also won’t give a 404. What you have to do is explicitly return a 404 page when resource\_type.name is not matched.

```lia-code-sample
{% if dynamic_page_hubdb_row %}
 {% if dynamic_page_hubdb_row.resource_type.name == 'whitepapers' %}
 <!-- Render the whitepapers content -->
 <div class="whitepapers-main-cont container">
 <!-- existing hero, etc. -->
 </div>
 {% else %}
 {{ set_response_code(404) }}
 <div class="error-container">
 <h1>404 - Not Found</h1>
 <p>The resource you are looking for does not exist or is of the wrong type.</p>
 </div>
 {% endif %}
{% elif dynamic_page_hubdb_table_id %}
 <!-- Index listing page -->
 <div class="resources-hero resource-hero-bg">...</div>
 <div class="resource-main-container container">
 <!-- listing logic -->
 </div>
{% else %}
 {{ set_response_code(404) }}
 <div class="error-container">
 <h1>404 - Not Found</h1>
 </div>
{% endif %}

```

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.

Thanks!

---

<div class="post-metadata">

**Author:** ![TSwisher008](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@TSwisher008](https://community.hubspot.com/u/TSwisher008)\
**Post date:** [June 26, 2025, 1:59pm UTC](https://community.hubspot.com/t/multi-resource-hubdb-table/135109/4 "2025-06-26T13:59:54Z")

</div>

Thank you for the reply. One of the big issues for me was

`{{ set_response_code(404) }}`

never updated the response header. It was still giving out a 200.
