the goal here is really to display the dynamic page of product, with the correct URL slugs
product-category/product-subcategory/product-item
What I did, I created a normal pages for each product categories and product sub categories. On product sub category pages, I bind the the hubdb. This causes the dynamic pages multiply. For example, we have 298 rows on the HubDB, and we have 14 normal pages; 298 x 14 = 4172 URL pages. This is where it became pretty disastrous on SEO part.
I don't know if I understood your question well, but i will try help.
HubDB must be connected in only 1 page, because HubDB create the subpages for each row, in page with is connected.
If you want to create pages from the subcategories, I believe you can do this by pulling the information from HubDB, WITHOUT having to connect HubDB to the page. Using the table ID, you can pull the information from HubDB without linking to the category pages. So it does not generate new pages creating duplicate content.
But in all pages i get some informations of table. Example: in my mega menu, all items are of HubDB rows. You can get informations of HubDB without connect in each page. Then you must connect only in page with you want to create the dynamic sub pages.
Example of my global menu using informations of HubDB without connect page in HubDB:
<ul>
<li><a href="#CURSOS">Graduação <i class="arrow-menu arrow-down"></i></a>
<div class="megamenu-all-courses">
<div class="megamenu-item graduacao">
{% set dynamic_page_hubdb_table_id = 2621653 %}
{#{% if dynamic_page_hubdb_row %}#}
{% elif dynamic_page_hubdb_table_id %}
<ul>
{#{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id) %}#}
{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id, "&active__eq=s")|sort(False, False, 'hs_name') %}
{#<li><a href="{{ request.path }}/{{ row.hs_path }}">{{ row.h1_header }}</a></li>#}
<li><a href="https://ead.univali.br/cursos-graduacao/{{ row.hs_path }}">{{ row.h1_header }}</a></li>
{% endfor %}
</ul>
<a href="https://ead.univali.br/cursos-graduacao/" class="view-all-courses">VER TODOS OS CURSOS</a>
{#{% endif %}#}
</div>
</div>
</li>
<li><a href="#CURSOS">Pós-Graduação <i class="arrow-menu arrow-down"></i></a>
<div class="megamenu-all-courses">
<div class="megamenu-item pos">
{% set dynamic_page_hubdb_table_id = 2624526 %}
{#{% if dynamic_page_hubdb_row %}#}
{% elif dynamic_page_hubdb_table_id %}
<ul>
{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id, "&active__eq=s")|sort(False, False, 'hs_name') %}
<li><a href="https://ead.univali.br/cursos-pos-graduacao/{{ row.hs_path }}">{{ row.h1_header }}</a></li>
{% endfor %}
</ul>
<a href="https://ead.univali.br/cursos-pos-graduacao/" class="view-all-courses">VER TODOS OS CURSOS</a>
<a href="https://ead.univali.br/pos-graduacao-ead" class="btn-pos-ead">QUERO SER CONVENCIDO</a>
{#{% endif %} #}
</div>
</div>
</li>
</ul>
Did this post help solve your problem? If so, please mark it as a solution.
I don't know if it would be ideal, but a possible solution for you would be to have a HubDB for each category and thus link each one on its respective page.
Then on the PRODUCTS page, you do not connect any HubDB, but via code you can pull the products from the subcategory tables to create a listing.
Did this post help solve your problem? If so, please mark it as a solution.