dynamic_page_route_level == 3 is not working

Hi there,

We built multilevel dynamic pages with HubDB. but the level 3 is not working. Level 0, level 1, and level 2 are working well. but when goes to level 3, the page is turned to 404. there are two conditions on the level 3 page, either showing the product template (not the child table) or showing the product type page (child table). here is my code.

 {% if dynamic_page_route_level == 0 %}
 <!--SUB-CATEGORY LEVEL TEMPLATE-->
 {% if dynamic_page_hubdb_row.hs_child_table_id == 2693272 %}
 PRODUCT LEVEL
 {% else %}
 {% module "module_160324179757452" path="/NIT September 2020/modules/Hero Banner", label="Hero Banner" %}
 {% module "module_16030679067677" path="/NIT September 2020/modules/Product blurb Section", label="Product blurb Section" %}
 {% module "module_160322491469835" path="/NIT September 2020/Global Module/Contact Us Section", label="Contact Us Section" %}
 {% endif %}
 {% elif dynamic_page_route_level == 1 %}
 {% if dynamic_page_hubdb_row.hs_child_table_id == 2693272 %}

 {% if dynamic_page_hubdb_row.name == "GENUINE NITTO CUPLAS" %}
 {% module "module_160344031487742" path="/NIT September 2020/modules/Cuplas Hubdb Banner", label="Cuplas Hubdb Banner" %}
 {% module "module_160324177270051" path="/NIT September 2020/modules/Breadcrumbs", label="Breadcrumbs" %}
 {% module "module_160344041954244" path="/NIT September 2020/modules/Cuplas Description Cm", label="Cuplas Description Cm" %}
 {% module "module_160344044648446" path="/NIT September 2020/modules/Related Information Cm", label="Related Information Cm" %}

 {% set product_categories_param = "orderBy=name&category="~dynamic_page_hubdb_row.name %} 
 <div class="product-sub-section" style="background-color:#A7A8AA;">
 <div class="content-wrapper">
 <div class="main-heading">
 <h2>
 CUPLA- AIR (LOW PRESSURE)
 </h2>
 </div>
 <div class="product-filter-wrapper">
 <div class="filter__wrapper">
 <div class="filter-heading">
 <h4>
 REFINE SEARCH
 </h4>
 </div>
 <ul class="filter-inner"></ul>
 <style>
 .filter-inner > li > ul{
 display:none;
 }
 </style>

 </div>
 <div class="product__wrapper">
 {% for row in hubdb_table_rows(2693272, product_categories_param) %}
 <a class="products {% for tag in row.search_tag %}{{ tag.name|regex_replace("[^a-zA-Z0-9]", "") }} {% endfor %}" href="{{ request.path }}/{{ row.hs_path }}">
 <div>
 <div class="hs_cos_wrapper">
 <div class="image-container">
 <img src="{{row.tile_image.url}}">
 </div>
 <div class="details body_font_tertiary">

 <h5>
 {{ row.name }}
 </h5>

 <ul style="background: #000;">
 {% for tag in row.search_tag %}
 <li>{{ tag.name }}</li>
 {% endfor %}
 </ul>
 </div>
 </div>
 </div>
 </a>
 {% endfor %}
 </div>
 </div>
 </div>
 </div>
 {% else %}
 <!--If category doesn't have subcategory, show product listing here-->

 {% module "module_160324179757452" path="/NIT September 2020/modules/Hero Banner", label="Hero Banner" %}
 {% module "module_160324177270051" path="/NIT September 2020/modules/Breadcrumbs", label="Breadcrumbs" %}
 <section class="clearfix product_category_details">
 <div class="content-wrapper category_details">
 <div class="page-center"> 

 {#pull level 0 category name and detail here #}
 <h2>{{dynamic_page_hubdb_row.name}}</h2>
 <span class="">{{ dynamic_page_hubdb_row.detail_description }}</span>
 </div>
 </div>
 </section>
 {#list product without sub category#}

 {% set product_categories_param = "orderBy=name&category="~dynamic_page_hubdb_row.name %} 
 {{product_categories_param}}
 <div class="three-col-product four-col-product no-blue-bg withproduct" style="background-color:#A7A8AA;">
 <div class="content-wrapper">
 <div class="cm-container">
 <span> 
 {% for row in hubdb_table_rows(2693272, product_categories_param) %}

 <a href="{{ request.path }}/{{ row.hs_path }}" class="hs_cos_wrapper">
 <div class="threecol-prodimage">
 <img src="{{row.tile_image.url}}">
 </div>
 <div class="details body_font_tertiary">

 <h5>
 {{ row.name }}
 </h5>

 </div>
 </a>
 {% endfor %}
 </span>
 </div>
 </div>
 </div>

 {% endif %} 

 {% endif %}

 {% if dynamic_page_hubdb_row.hs_child_table_id == 2693245 %}
 <!-- if page have sub-category page -->

 {% set product_categories_param = "orderBy=name&category="~dynamic_page_hubdb_row.name %} 
 <section class="clearfix product_category_details">
 <div class="content-wrapper category_details">
 <div class="page-center"> 
 {#pull level 0 category name and detail here #}
 <h2>{{dynamic_page_hubdb_row.name}}</h2>
 <span class="">{{ dynamic_page_hubdb_row.detail_description }}</span>
 </div>
 </div>
 </section>
 <!--list sub category-->
 <div class="three-col-product four-col-product no-blue-bg withsubcategory" style="background-color:#A7A8AA;">
 <div class="content-wrapper">
 <div class="cm-container">
 <span> 
 {% for row in hubdb_table_rows(2693245, product_categories_param) %}

 <a href="{{ request.path }}/{{ row.hs_path }}" class="hs_cos_wrapper">
 <div class="threecol-prodimage">
 <img src="{{row.featured_image.url}}">
 </div>
 <div class="details body_font_tertiary">

 <h5>
 {{ row.name }}
 </h5>

 </div>
 </a>
 {% endfor %}
 </span>
 </div>
 </div>
 </div>

 {% endif %}

 {% elif dynamic_page_route_level == 2 %} 

 {% if dynamic_page_hubdb_row.hs_child_table_id == 2895410 %}
 <!--show main product page here, 2895410 is for cuplas product type-->
 <!-- DYNAMIC PAGE - CHILD PAGE = {{dynamic_page_hubdb_row.hs_child_table_id}} -->
 {#product page template#}

 {% include "/NIT September 2020/templates/Product page.html" %}
 {% endif %}

 {% if dynamic_page_hubdb_row.hs_child_table_id == 2693272 %}
 <!-- If page is a second level category -->

 {% set CategoryParam = "orderBy=name&sub_category="~dynamic_page_hubdb_row.name %}
 <section class="clearfix category_details">
 <div class="content-wrapper">
 <div class="cm-container">
 <div class="page-center"> 
 {#pull level 1 category name and detail here #}
 <h2>{{dynamic_page_hubdb_row.name}}</h2>
 <span class="">{{ dynamic_page_hubdb_row.detail_description }}</span>

 </div>
 </div>
 </div>
 </section>
 <!-- second level category product listing-->

 <div class="three-col-product four-col-product no-blue-bg no-thirdcategory-productlevel2" style="background-color:#A7A8AA;">
 {{CategoryParam}}
 <div class="content-wrapper">
 <div class="cm-container">
 <span>
 {% for item in hubdb_table_rows(2693272, CategoryParam) %}
 <a href="{{ request.path }}/{{ item.hs_path }}" class="hs_cos_wrapper">
 <div class="threecol-prodimage">
 <img src="{{item.tile_image.url}}">
 </div>
 <div class="details body_font_tertiary">

 <h5>
 {{ item.name }}
 </h5>
 <h6> {{ item.small_description }}</h6>

 </div>
 </a> 
 {% endfor %}
 </span>
 </div>
 </div>
 </div>

 {% endif %}
 {% elif dynamic_page_route_level == 3 %}

 {% if dynamic_page_hubdb_row.hs_child_table_id == 2895410 %}
 <!--show level 3 product here-->
 <!--product template here, can use the product page template-->

{% include "/NIT September 2020/templates/Product page.html" %}

 {% else %}
 <!--if product has child type, show template here-->
 <section class="clearfix product_list">
 <div class="content-wrapper">
 <div class="cm-container">
 <div class="page-center">
 <div class="pro-container">
 <div class="prod-detail">
 <div class="product-logo">
 <img src="{{dynamic_page_hubdb_row.logo.url}}" />
 </div>
 <div class="prod-gallery">
 <img src="{{dynamic_page_hubdb_row.feature_image.url}}">
 </div>
 </div>
 <div class="prod-detail">
 <div class="prod-info">
 <h1 class="product-title-h1">{{ dynamic_page_hubdb_row.name }}</h1>
 <h5 class="short_diameter">{{ dynamic_page_hubdb_row.sub_title}}</h5>
 <img src="{{dynamic_page_hubdb_row.tile_image.url}}">
 </div>
 </div>
 </div>
 </div>
 </div>
 </div>
 </section>

 {% endif %}
 <!--end of product wrap-->
 {% elif dynamic_page_route_level == 4 %}
 <!--level 4 show cuplas product type-->
 <section class="clearfix product_list">
 <div class="content-wrapper">
 <div class="cm-container">
 <div class="page-center">
 <div class="pro-container">
 <div class="prod-detail">
 <div class="product-logo">
 <img src="{{dynamic_page_hubdb_row.logo.url}}" />
 </div>
 <div class="prod-gallery">
 <img src="{{dynamic_page_hubdb_row.feature_image.url}}">
 </div>
 </div>
 <div class="prod-detail">
 <div class="prod-info">
 <h1 class="product-title-h1">{{ dynamic_page_hubdb_row.name }}</h1>
 <h5 class="short_diameter">{{ dynamic_page_hubdb_row.sub_title}}</h5>
 <img src="{{dynamic_page_hubdb_row.tile_image.url}}">
 </div>
 </div>
 </div>
 </div>
 </div>
 </div>
 </section>

 {% endif %}

.

Hey @abbyxia ,

I saw that you also reached out to support for this and it looks like it was resolved. For the sake of the community, could you share the answer here as well?

Problem solved! the code is correct. Once we enabled the automatically create listing pages for child tables for each parent table. then the whole structure starts working well. Even the level 4 page.