filter hubdb results based on field

shaundraws
Member

Feel free to just point me in the right direction here but I can't seem to figure out the syntax for what should be really simple. I just want to be able to select a "region" while placing a custom module that references a HubDB, then display results from that region. 

 

I don't need search or anything like that just a basic filter.

 

module code shown below with my attempt at filtering using an IF tag, however the syntax is incorrect.

0 Upvotes
1 Reply 1
shaundraws
Member

Here's the complete module code, the error is in row 7 (as follows):  {% if {{ module.region }} = {{ row.region }}%} 

 

{% set table = hubdb_table_rows(849103, queryparam)%}
{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}
<div class="main-carousel">
{% for row in table %}
{% if {{ module.region }} = {{ row.region }}%}
{% cycle '<div class="team-vert-stack">','' %}
<a href="{{ row.avatar.url }}" title="{{ row.name }}" data-position="{{ row.position }}" data-bio="{{ row.bio }}" data-skill1="{{ row.skill_1 }}" data-skill_1_pcnt="{{row.skill_1_pcnt}}" data-skill2="{{ row.skill_2 }}" data-skill_2_pcnt="{{row.skill_2_pcnt}}" data-skill3="{{ row.skill_3 }}" data-skill_3_pcnt="{{row.skill_3_pcnt}}" data-skill4="{{ row.skill_4 }}" data-skill_4_pcnt="{{row.skill_4_pcnt}}" class="gallery__image">
<div class="team-member-card">
<div class="hs-featured-image-wrapper">
<div class="hs-featured-image">
<img src="{{ row.avatar.url }}" width="500" alt="{{ row.name }} Headshot">
</div>
</div>
<div class="team-member-info">
<h3>{{ row.name }}</h3>
</div>
</div>
</a>
{% cycle '','</div>' %}
{% if loop.last %}
{% if loop.index is odd %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endif %}

0 Upvotes