Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
selectattr filter questions
SOLVE
Highlighted
Regular Contributor
04-11-2019 04:36
I have the following code to filter rows in a DB table:
{% set table = hubdb_table_rows(1040830, queryparam) %}
After those rows are returned I have the following code to further list the results:
{% set easi_set_buildings = table|selectattr('catid','equalto','eset-std') %} {% if easi_set_buildings == [] %} <!-- Do Nothing --> {% else %} <h3>Headline</h3> {% for row in easi_set_buildings %} Do Stuff {% endfor %} {% endif %}
This is working fine.
Here are my questions.
1. I tried using the following:
{% set easi_set_buildings = table|selectattr('catid','containing','eset-std') %}
and nothing happened.
Can I use the selectattr filter when referencing a multi select column (or a column that contains multiple values)?
2. Can I apply multiple "requests" to the selectattr filter... like:
{% set easi_set_buildings = table|selectattr('catid','equalto','eset-std' AND 'subcatid','containing','blah') %}
Any help is greatly appreciated.
Thanks!
Solved! Go to Solution.
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content