HubDB dynamic pages with Products

etdubria14
Member

I am currently working with a client on his Product pages. 

 

Here's how I integrated the Products on Hubdb.

1. Created a Hubdb for Products, this have columns such as the Product name, product category, product sub category, and other details.

2. Created normal pages for product subcategory and attached the hubdb. This way I achieved the 

product-category/product-subcategory/product-name URL

 

The issue:

This approach created each rows a dynamic pages on each normal pages that uses the same HubDB. A major redundacy and issues on SEO part.

 

I saw the same post but no further answer were made.

https://community.hubspot.com/t5/CMS-Development/Many-dynamic-pages-getting-creating-out-of-HubDB/m-...

 

Hope someone can help me on this.

 

Thanks

 

 

 

0 Upvotes
6 Replies 6
DanielSanchez
Key Advisor

Hi @etdubria14 ,

 

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.

 

In this project, i have the page with connected in HubDB: https://ead.univali.br/cursos-graduacao/

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.

Best regards! 🙂

etdubria14
Member

Hi,

 

Thank you for your responds.

 

Based on your suggestion, if we bind the Hubdb on one single page,. it would be not possible to have the url slug like this

/products/category1/sub-category-1/product-item

 

Much it seems, the url will be come like this

/products/product-item

 

I will try to explain this as much as I can. 
Here are the goals on the product pages.

1. Create a Product page with HubDB, generating the dynamic pages.

2. The pages are group by Product Categories, Product Sub Categories and Product item 

3. So first we should have www.example.com/products  - this page will contain list of all the Product Categories

The URL should be 

www.example.com/products/category1 

www.example.com/products/category2 

www.example.com/products/category3 

This page should contain the list of sub categories for the product categories

 

4. When you visit one of the sub category on the list, the next url should be like this

www.example.com/products/category1/sub-category-1 

www.example.com/products/category1/sub-category-1-2 

www.example.com/products/category1/sub-category-1-3 

 

www.example.com/products/category2/sub-category-2 

www.example.com/products/category2/sub-category-2-1 

www.example.com/products/category2/sub-category-2-2 

 

www.example.com/products/category3/sub-category-3 

www.example.com/products/category3/sub-category-3-1 

This page should have the list of product items

 

5. The next page should contain the product item information and will have the URL like this

www.example.com/products/category1/sub-category-1/product-item1 

www.example.com/products/category1/sub-category-1-2/product-item-1-2 

www.example.com/products/category1/sub-category-1-3/product-item-1-3 

 

Is there a way to achieve this on the HubDB without making a lot of tables? 

 

I hope it make sense. 

 

Thank you

0 Upvotes
DanielSanchez
Key Advisor

Hi @etdubria14 ,

 

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.

Best regards! 🙂

Philip_Marsh
Contributor

Hi,

 

Could you clarify what the end result you are looking for is, please? What do you want to happen?

 

Do you have a link to the page to review? Sorry for the questions

0 Upvotes
etdubria14
Member

Hi,

 

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. 

 

Does it make any sense?

 

Thanks

0 Upvotes
Philip_Marsh
Contributor

This is probably the best solution within Hubspot. 

 

How to build multilevel dynamic pages with HubDB (hubspot.com)

 

It used multiple databases but I think this is the closest solution to your problem.