Skip to main content
added 496 characters in body
Source Link
Siebird
  • 373
  • 1
  • 11

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

Update

Currently not ideal. Using a conditional to filter the correct row, but will work now ¯\_(ツ)_/¯

{% for range in profile.scoreRanges %}
    {% if result.points >= range.range.from and result.points <= range.range.to %}
        <p><span class="label label-warning">Range:</span> {{ range.range.from }} - {{ range.range.to }}<br> <span class="label label-primary">Your Score:</span> <b>{{ result.points }}</b></p>
        {{ range.summary }}
    {% endif %}
{% endfor %}

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

Update

Currently not ideal. Using a conditional to filter the correct row, but will work now ¯\_(ツ)_/¯

{% for range in profile.scoreRanges %}
    {% if result.points >= range.range.from and result.points <= range.range.to %}
        <p><span class="label label-warning">Range:</span> {{ range.range.from }} - {{ range.range.to }}<br> <span class="label label-primary">Your Score:</span> <b>{{ result.points }}</b></p>
        {{ range.summary }}
    {% endif %}
{% endfor %}
edited tags; edited title
Source Link
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

Search using the MX Range Slider plugin

I have a super table field (scoreRanges) that has two columns: mx range slidermx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

Search MX Range Slider

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

Search using the MX Range Slider plugin

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

added 12 characters in body
Source Link
Siebird
  • 373
  • 1
  • 11

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

I have a super table field (scoreRanges) that has two columns: mx range slider (range) & rich text (summary). Some entries can have multiple rows:

enter image description here

I'm trying search a row in that field that has a range between a certain value. MX range slider saves data ranges to the database text field like 9;20 which is a range from 9 to 20.

Does anyone have an idea of how to search for a row between a certain range? So far I have tried this which returns no results.

{% for range in profile.scoreRanges.range('and', '>=' ~ result.points, '<=' ~ result.points) %}
...
{% endfor %}

On the template side, I have variables like {{ range.range.from }} & {{ range.range.to }} to use.

Source Link
Siebird
  • 373
  • 1
  • 11
Loading