I’m facing the following challenge. I need to create a product page, which has two internal products. I will explain my objective and what I tried so far. I am open to new solutions or how to improve solution 2 that I think is close to solving my problem.
So the idea is to have a page, ‘myurl/product’, with internal navigation to the other pages than can be also acessible from ‘myurl/product/product-a/’ and ‘myurl/product/product-b’.
A good example of what I’m trying to achieve would be this hubspot sales page: Marketing Software Pricing | HubSpot.
Failed Solution 1: Javascript Tabs
I know that something similar could be achieved with javascript/jquery tabs, hiding and showing sessions when they click on specific links, but it was requested that the page has to have its own URL and that don’t reload when changing internal products. So that solution at the moment was not viable.
Solution 2: Hubspot Dynamic Pages
I saw that the dynamic pages would give almost everything I need. I followed the documentation tutorial and I believe I got 90% of what I wanted. The problem is that when creating the page, I was not able to allow the user to change the content of the internal pages through the modules.
I will try to show my current situation in practice with images and code. If anything else is needed, you can ask me.
The complete code:
<h1>Header for both pages</h1>
{% if dynamic_page_hubdb_row %}
{% module "module_158708778140132" path="@hubspot/rich_text", label="Description of Internal Product" %}
<h4>Internal Product</h4>
<ul>
{% for categoria in hubdb_table_rows(1044913, 'orderBy=Nome') %}
{% set string_to_split = request.path %}
{% set names = string_to_split|split('/', 4) %}
<li><a href="/{{ names[0] }}/{{ categoria.hs_path }}">{{ categoria.Nome }}</a></li>
{% endfor %}
</ul>
{% elif dynamic_page_hubdb_table_id %}
{% module "module_158708613337118" path="@hubspot/header", label="Header Main Product Page" %}
{% for categoria in hubdb_table_rows(1044913, 'orderBy=Nome') %}
<p><a href="{{ request.path }}/{{ categoria.hs_path }}">{{ categoria.Nome }}</a></p>
{% endfor %}
{% endif %}
So here I have one header module to the main product page:
...
{% module "module_158708613337118" path="@hubspot/header", label="Header Main Product Page" %}
...
And here I have a rich text module to the internal product page
...
{% module "module_158708778140132" path="@hubspot/rich_text", label="Description of Internal Product" %}
...
So the main problem is, when in template mode, only the module of the main product page is displayed to edit. I can’t figure it out if it’s possible to change view to edit a internal product page and their modules at pages, that will be nice too.
I know I could probably do this by extracting data from HubDB. But it would be better if they could make this kind of change visually.
I publish the page in case it helps to understanding: http://hubspot-developers-7e1rdy-5987512.hs-sites.com/testeee
Summary Questions:
- Is there a way to show the internal pages of a ‘dynamic page’ within the page edition?
- Is it possible to put modules to customize internal pages of ‘dynamic pages’?
- Can I do something similar to the hubspot sales page without using HubDB and, at the same time, keep the editing options through modules… with customized URLs and without updating the page?
