CMS Development

Cameron
Contributor

Pulling HubDB table into a Dynamic Page

I have built pages from a "dynamic pages HubDB table" and I need to pull in related data from a "module specific HubDB table".

 

 

I want to find a matching bit of text across both tables and pull a piece of data from the module data table if it is present in both.

 

How do I get the page template to reference the module data table?

 

 

Cheers in advance.

 

0 Upvotes
1 Reply 1
Jsum
Key Advisor

Pulling HubDB table into a Dynamic Page

@Cameron,

 

You just need to pull in both tables

 

{% set table1 = hubdb_table_rows({Insert YOUR Table ID}, queryparam) %}
{% set table2 = hubdb_table_rows({Insert YOUR Table ID}, queryparam) %}

Then do nested for loops and if statements to cross reference the data. 

 

 

Read this tutorial and check out the HubDB docs and you should be able to come up with the logic no problem.