Module, Plugin

Archived
Forum
(read-only)

Reefine

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Patrick Woodcock

     

Multipe Select for Relationship-Field

Support (Resolved)

amadeus
amadeus

Great addon!

Trying to use a multiple select Filter for a relationship field. It works when I select a single entry in the multiple select. When I select two entries, it only shows ONE entry. Even the url is not combined with “-or-”? Here is my reefine tag:

{exp:reefine 
channel
="ddb_deals" 
filter:customer:fields="ddb_deal_customer"
filter:customer:label="Customer"
filter:customer:delimiter="|"
url="/{segment_1}/{customer}"
parse="inward"
status="Public|Open"

and here is the filter part:

<form method="get" action="/{segment_1}">
   <
div class="select-filter">
        <
fieldset>
            <
label id="customer_label" for="customer_select">Filter by customer</label>
            <
select name="customer" id="customer_select" aria-describedby="customer_label customer_select" multiple>
       <
option value="">Any type</option>
       
{customer}
       {filters}
       
<option value="{filter_value}" {if filter_active}selected{/if}>{filter_title} ({filter_quantity})</option>
       
{/filters}
       {
/customer}
            
</select>
        </
fieldset>
        <
button type="submit" class="apply-filter filter1">Apply Filter</button>
        <
a href="/{segment_1}" class="apply-filter filter2 selected">Show All</a>
      </
div>
  </
form

What is wrong?

Ralph
# 1
Ralph

Hi.

Thanks, glad you like Reefine. I haven’t tested using <select multiple> before so that may be the issue. I’ll investigate when I’m back in the office tomorrow.

Cheers
Patrick.

amadeus
# 2
amadeus

Hi,

thank you for answering so fast! Because everything is documented so well I thought so that maybe the multiple select option was not considered or tested ... it would be really great if I could bring this to live with your help :)

Looking forward to hear from you!

Ralph
# 3
Ralph

Hi

Can you try adding [] to the end of the name param on select, like this:

<select name="customer[]" id="customer_select" aria-describedby="customer_label customer_select" multiple

Cheers
Patrick.

amadeus
# 4
amadeus

Works! Great…

Ralph
# 5
Ralph

Great, let me know if you have any other questions.