We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Apr 20, 2022 12:17 PM
Hi,
apologises if this is a dumb question, but I'm very tired and have been working on a new FAQ section all day, and I think I'm burnt out.
Set up:
I have a Parent HudDB, that connects to Child DB's. My FAQ section has 3 dynamic pages:
Problem:
What I want to achieve is on Page 3, the Answers page. I want the page to include a list of Questions from the Child DB. I can get this list working on Page 2 using the following code, but for some reason, this code doesn't want to work on Page 3. Any advice on how to do this?
{% set queryparam = "&orderBy=order" %}
{% set rows = hubdb_table_rows(dynamic_page_hubdb_row.hs_child_table_id) %}
{% for row in rows %}
<div>
<div class="faq-btn" data="img{{loop.index}}">
<p><span><a href="{{ request.path }}/{{ row.hs_path }}">{{ row.question }}</a></span>
<img class="plus" src="https://cdn2.hubspot.net/hubfs/4351639/2019/assets-may-2019/plus-bold.svg" alt="plus symbol">
</p>
</div>
</div>
{% endfor %}
The example page is below:
Solved! Go to Solution.
Apr 22, 2022 5:29 AM - edited Apr 22, 2022 5:38 AM
I figure it out, I had to use
dynamic_page_hubdb_table_id
Instead of
dynamic_page_hubdb_row.hs_child_table_id
Full code:
{% set queryparam = "&orderBy=order" %}
{% set rows = hubdb_table_rows(dynamic_page_hubdb_table_id) %}
{% for row in rows %}
<div>
<div class="faq-btn" data="img{{loop.index}}">
<p><span><a href="{{ request.path }}/{{ row.hs_path }}">{{ row.question }}</a></span>
<img class="plus" src="https://cdn2.hubspot.net/hubfs/4351639/2019/assets-may-2019/plus-bold.svg" alt="plus symbol">
</p>
</div>
</div>
{% endfor %}
Apr 22, 2022 3:41 AM - edited Apr 22, 2022 3:42 AM
hi,
is this value filled on page2/3
dynamic_page_hubdb_row.hs_child_table_id
because i think on page 2 u dont have connect to parent first table request
Apr 22, 2022 4:40 AM
On page 2, it's
{% set rows = hubdb_table_rows(dynamic_page_hubdb_row.hs_child_table_id) %}
And that works, and I'm using the same code on Page 3, as it is, and it no longer works. I assume because when I'm on page 3, it can only check what's in a single row, rather than the entire DB?
The child database has 2 columns:
Page 3 I have displaying a single Question, with the corresponding answer. What I also need is a list of the other Questions in that child database.
Apr 22, 2022 4:55 AM
Hello,
I rather think that he loses his reference to "page2" iwo do you pass parameters in the url? would it be easier to work with url parameters so that you are permanently saved and can also share the links?
Apr 22, 2022 5:29 AM - edited Apr 22, 2022 5:38 AM
I figure it out, I had to use
dynamic_page_hubdb_table_id
Instead of
dynamic_page_hubdb_row.hs_child_table_id
Full code:
{% set queryparam = "&orderBy=order" %}
{% set rows = hubdb_table_rows(dynamic_page_hubdb_table_id) %}
{% for row in rows %}
<div>
<div class="faq-btn" data="img{{loop.index}}">
<p><span><a href="{{ request.path }}/{{ row.hs_path }}">{{ row.question }}</a></span>
<img class="plus" src="https://cdn2.hubspot.net/hubfs/4351639/2019/assets-may-2019/plus-bold.svg" alt="plus symbol">
</p>
</div>
</div>
{% endfor %}
Apr 22, 2022 5:36 AM
Apr 22, 2022 5:38 AM
Done. I also edited it to include the full example
Apr 21, 2022 8:21 AM
Hello @Philip_Marsh,
Please check your page-2 and page-3 specifications, both should be the same.
If they are same then please let me know what error you are getting on implementing the code for page-3.
Apr 21, 2022 10:06 AM - edited Apr 21, 2022 10:07 AM
Hi, sorry, what do you mean by
@himanshurauthan wrote:Hello @Philip_Marsh,
Please check your page-2 and page-3 specifications, both should be the same.
Thanks,