CMS Development

rainism
Member

HubDB - Filter results of a module snippet

SOLVE

Hello,

 

Is it possible to filter results of a custom module if I added a snippet to a HTML/Hubl template for dynamic pages so I need to print specific rows on the spefic pages?

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

HubDB - Filter results of a module snippet

SOLVE

Hey @rainism 

 

This sounds interesting, could you provide a little more detail? Maybe provide a scenario or business case?

 

But to guess:

With dynamic pages you can use an if statement to query the route level like this:

{% if dynamic_page_route_level == 0 %}

Then iterate through your rows:

{% set rows = hubdb_table_rows(XXXXXX) %}
      {% for row in rows %}
{{ printData }:

 To get more specific you could add another column to your Tables and query against that too.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

0 Upvotes
2 Replies 2
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

HubDB - Filter results of a module snippet

SOLVE

Hey @rainism 

 

This sounds interesting, could you provide a little more detail? Maybe provide a scenario or business case?

 

But to guess:

With dynamic pages you can use an if statement to query the route level like this:

{% if dynamic_page_route_level == 0 %}

Then iterate through your rows:

{% set rows = hubdb_table_rows(XXXXXX) %}
      {% for row in rows %}
{{ printData }:

 To get more specific you could add another column to your Tables and query against that too.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
rainism
Member

HubDB - Filter results of a module snippet

SOLVE

Yes, I added a specific column to my tables and it helped. Thank you!