HubDB - Filter results of a module snippet

SOLVE
Highlighted
Regular Contributor

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?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Advisor

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.

Reply
0 Upvotes
2 Replies 2
Advisor

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.

Reply
0 Upvotes
Regular Contributor

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