Hello all,
I want to combine dataasets from two columns from a hubDB table and pull the data into a filter. Here is a part of the code that I am using below:
<div id="container">
{% set table = hubdb_table_rows(2034103) %}
{% for row in table %}
<div class="item {% for category in row.filter_item %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %}">
<div class="item-inner">
<h3>{{ row.Name }}</h3>
<div class="grid-descr">
{{ row.content }}
</div>
<a href="{{ row.button_link }}" target="_blank" class="learn_more_btn">Learn More</a>
</div>
</div>
{% endfor %}
</div>
</div>
I tried the following for this specific snippet (changes shown in red):
<div class="item {% for category in (row.filter_item or row.molecule_class) %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %}">
because I wanted to combine the two columns and pull data from both columns.. but it doesn’t seem to be working for me for some reason. Am I doing anything wrong? Is this the correct way to combine columns?
Thanks!