“size_1” and “size_2” are numbers fields.
“sizes” is a text field.
Example:
“sizes” == 10 x 15
“size_1” == 10
“size_2” == 15
This is done so that I can show “sizes”, but use “Size_1” to orderBy.
If I order by “sizes”, it’s 1,10,2,200,33,4,500,6 etc.
If ordered by “size_1”, I can make it 1,2,4,6,10,33,200,500
I’m using stash for this, and doing a exp:query loop.
{exp:stash:set_list parse_conditionals="no" name="consolidatedList" trim="yes" parse_tags="yes" refresh="1440"} {exp:query sql="SELECT DISTINCT field_id_141, field_id_26, field_id_27, field_id_142 FROM exp_channel_data"} {if ('{field_id_142}' != 'Mosaik') AND ('{field_id_141}' != '0x0') AND ('{field_id_141}' != '999x999')} {stash:storlekarNoDes}{field_id_141}{/stash:storlekarNoDes} {/if} {stash:storlek_1}{field_id_26}{/stash:storlek_1} {stash:storlek_2}{field_id_27}{/stash:storlek_2} {/exp:query} {/exp:stash:set_list}
And then outputting it to reefine-flter like so:
<div class="reefine-filter-holder"> <h6>Storlek (cm)</h6> {exp:stash:get_list name="consolidatedList" orderby="storlek_1" sort="asc|asc" unique="storlekarNoDes" match='#.+#' against="storlekarNoDes" } {if count == 14} <section class="show-more-of-sizes" style="display:none;"> {/if} <div class="filter-name {if '{segment_4}' *= '{storlekarNoDes}'}active{/if}"> <a href="{site_url}keramik/index_reefine/ {if '{segment_3}' == ''}typ{if:else}{segment_3}{/if}/ {if '{segment_4}' == 'storlek'}{storlekarNoDes}{if:elseif '{segment_4}' == ''}{storlekarNoDes}{if:else}{segment_4}-or-{storlekarNoDes}{/if}/ {if '{segment_5}' == ''}farg{if:else}{segment_5}{/if}/ {if '{segment_6}' == ''}yta{if:else}{segment_6}{/if}/ {if '{segment_7}' == ''}egenskap{if:else}{segment_7}{/if}/ {if '{segment_8}' == ''}serie{if:else}{segment_8}{/if}/ ">{storlek_1} x {storlek_2}</a> </div> {if count == total_results} </section> {/if} {/exp:stash:get_list} <div class="show_more_sizes">Visa alla</div> </div>
I was just wondering if there was a more reefing-way of doing it without the use of stash :)
So, problem solved, there’s not a reefing’er way :)
Thanks! :)
|