How to show listing of single column data from hubdb table with conditional base in module
I want to select people name with active people(active=true) from hubdb in module fields Hubdb row. Here name and active are two column name from Hubdb table name 'peoples'.
More info about the query parameters can be found over here.
{# Set the HubDB ID or name. #}
{% set db = '<tableID or name>' %}
{# Set query parameters and display only active people #}
{% set queryparam = '&active=true' %}
{# Set rows #}
{% set rows = hubdb_table_rows(db, queryparam) %}
{% for row in rows %}
{{ row.name }}
<hr>
{% endfor %}
How to show listing of single column data from hubdb table with conditional base in module
Hey
Can you please tell me if I want to show selected rows data on listing page so how to do it? I added a column named as "Main Listing order" in hubdb table in which i added numbers from 1 to 6 so that the listing shown according to this column
<div class="boxlayout-listing"> {% if dynamic_page_route_level == 0 %} {% set array = [] %} {% set table_categories = hubdb_table_rows(dynamic_page_hubdb_table_id) %} {% for row_category in table_categories %} {% set subcategories = hubdb_table_rows(row_category.hs_child_table_id) %} {% set table_data = hubdb_table_rows(row_category.table_id, "orderBy=main_listing_order", order="order ASC") %}
<div class="templates_head"> <h2 class="click-category main-listing-title"> {{row_category.name}} </h2> <a href="/templates/c/{{ row_category.hs_path }}" id="{{ catId }}" class="see_all"> View all<i class="fa fa-long-arrow-right" aria-hidden="true"></i> </a> </div> {% set obj = {val : 0} %} <ul class="template-list-view "> {% for row in table_data %} {% for choice in subcategories %} {% for cat in choice.category_name%} {% for sub in row.subcategory_name %} {% if sub.name == choice.name and cat.name == row_category.name %} {% if row.hs_id in array %} <div style="display:none">exist id - {{ row.hs_id }} - {{ array }}</div> {% else %}