<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Multi Resource hubDB Table in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1168767#M43370</link>
    <description>&lt;P&gt;I have a hubDB database to build dynamic pages with multiple resources (analyst reports, whitepapers etc. I have a single select column "resource_type.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've noticed that if I take the end slug from the resource and put it on the end of the example.com/resource/&lt;STRONG&gt;whitepaper&lt;/STRONG&gt;/my-slug or&amp;nbsp;/resource/&lt;STRONG&gt;analyst-report&lt;/STRONG&gt;/my-slug, it will render regardless because they are in the same database.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;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.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2025-06-24 at 12.30.10 PM.png" style="width: 665px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/149221iD0D91293820DF29E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-06-24 at 12.30.10 PM.png" alt="Screenshot 2025-06-24 at 12.30.10 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2025 18:33:16 GMT</pubDate>
    <dc:creator>TSwisher008</dc:creator>
    <dc:date>2025-06-24T18:33:16Z</dc:date>
    <item>
      <title>Multi Resource hubDB Table</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1168767#M43370</link>
      <description>&lt;P&gt;I have a hubDB database to build dynamic pages with multiple resources (analyst reports, whitepapers etc. I have a single select column "resource_type.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've noticed that if I take the end slug from the resource and put it on the end of the example.com/resource/&lt;STRONG&gt;whitepaper&lt;/STRONG&gt;/my-slug or&amp;nbsp;/resource/&lt;STRONG&gt;analyst-report&lt;/STRONG&gt;/my-slug, it will render regardless because they are in the same database.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;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.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2025-06-24 at 12.30.10 PM.png" style="width: 665px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/149221iD0D91293820DF29E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-06-24 at 12.30.10 PM.png" alt="Screenshot 2025-06-24 at 12.30.10 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 18:33:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1168767#M43370</guid>
      <dc:creator>TSwisher008</dc:creator>
      <dc:date>2025-06-24T18:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multi Resource hubDB Table</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169159#M43384</link>
      <description>&lt;P data-sourcepos="1:1-1:16"&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/888654"&gt;@TSwisher008&lt;/a&gt;,&lt;/P&gt;
&lt;P data-sourcepos="3:1-3:229"&gt;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.&lt;/P&gt;
&lt;P data-sourcepos="5:1-5:59"&gt;I'm tagging a few community members who can help with this:&lt;BR /&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/935114"&gt;@kosalaindrasiri&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/63499"&gt;@SteveHTM&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/577159"&gt;@GiantFocal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hopefully, they can provide some insights to help you sort this out!&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 15:14:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169159#M43384</guid>
      <dc:creator>Victor_Becerra</dc:creator>
      <dc:date>2025-06-25T15:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multi Resource hubDB Table</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169483#M43387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/888654"&gt;@TSwisher008&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main problem lies in the logic where it is finding an exact page match for the slug.&lt;BR /&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if dynamic_page_hubdb_row %}
  {% if dynamic_page_hubdb_row.resource_type.name == 'whitepapers' %}
    &amp;lt;!-- Render the whitepapers content --&amp;gt;
    &amp;lt;div class="whitepapers-main-cont container"&amp;gt;
      &amp;lt;!-- existing hero, etc. --&amp;gt;
    &amp;lt;/div&amp;gt;
  {% else %}
    {{ set_response_code(404) }}
    &amp;lt;div class="error-container"&amp;gt;
      &amp;lt;h1&amp;gt;404 - Not Found&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;The resource you are looking for does not exist or is of the wrong type.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  {% endif %}
{% elif dynamic_page_hubdb_table_id %}
  &amp;lt;!-- Index listing page --&amp;gt;
  &amp;lt;div class="resources-hero resource-hero-bg"&amp;gt;...&amp;lt;/div&amp;gt;
  &amp;lt;div class="resource-main-container container"&amp;gt;
    &amp;lt;!-- listing logic --&amp;gt;
  &amp;lt;/div&amp;gt;
{% else %}
  {{ set_response_code(404) }}
  &amp;lt;div class="error-container"&amp;gt;
    &amp;lt;h1&amp;gt;404 - Not Found&amp;lt;/h1&amp;gt;
  &amp;lt;/div&amp;gt;
{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this will help you out. Please mark it as &lt;/SPAN&gt;&lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt;&lt;SPAN&gt; to help another Community member.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 07:07:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169483#M43387</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2025-06-26T07:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multi Resource hubDB Table</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169710#M43396</link>
      <description>&lt;P&gt;Thank you for the reply. One of the big issues for me was&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{{ set_response_code(404) }}&lt;/PRE&gt;&lt;P&gt;never updated the response header. It was still giving out a 200.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 14:00:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Multi-Resource-hubDB-Table/m-p/1169710#M43396</guid>
      <dc:creator>TSwisher008</dc:creator>
      <dc:date>2025-06-26T14:00:28Z</dc:date>
    </item>
  </channel>
</rss>

