[Skip to main content](#vessel-content)

#   Replace "Select some options" with filter name?

##

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile") Topic Author
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

11 years 4 months ago -  11 years 4 months ago [\#206526](#206526) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206526 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")* was created by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")*

-- url of the page with the problem -- : local
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5.3

Hi,

I have several dropdown filters, all with title position = inside, to save space.
One is single dropdown, and the title (= filter name) indeed shows inside.
Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's "Select some options" showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.

See here when closed:
[ ![closed.jpg](/forum/attachment/25217) ](/forum/attachment/25217 "closed.jpg")

See here when opened:
[ ![open.jpg](/forum/attachment/25218) ](/forum/attachment/25218 "open.jpg")

How can the filter title/name be displayed instead of "Select some options"?

([strike]I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.[/strike] **Thanks!**)

**Edit:**
See update in next post.

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

- [ ![closed.jpg](/forum/attachment/25217) ](/forum/attachment/25217 "closed.jpg") [ ](/forum/attachment/25217?download=1 "closed.jpg")
- [ ![open.jpg](/forum/attachment/25218) ](/forum/attachment/25218 "open.jpg") [ ](/forum/attachment/25218?download=1 "open.jpg")
- [ ![filter.jpg](/forum/attachment/25219) ](/forum/attachment/25219 "filter.jpg") [ ](/forum/attachment/25219?download=1 "filter.jpg")

Last edit: 11 years 4 months ago by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile"). Reason: update in next post

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile") Topic Author
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

11 years 4 months ago [\#206535](#206535) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206535 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")*

> lousyfool wrote: (I have Chosen library enabled, and it seems to require a hack of a JS file.

Update:

So, I tried to quickly learn a bit about chosen and figured that one doesn't need to mess with its JS.
I went to see how you're doing it for single dropdown filters with title position inside, and found that you're making the magic happen in /administrator/components/com_hikashop/classes/filter.php, correct?

Looks like under "class hikashopSingledropdownClass extends hikashopFilterTypeClass" the block Code:

if($filter-&gt;filter_options['title_position']=='inside'){ $html.='&lt;OPTION VALUE="none"&gt;'.$filter-&gt;filter_name.'&lt;/OPTION&gt;';

is inserting filter_name for single dropdowns.

But under "class hikashopMultipledropdownClass extends hikashopSingledropdownClass", there's seemingly nothing to make it work for multiple dropdowns.
I tried messing with code a bit there, but can't get it to work. So, please let me re-phrase my question:

Can you please tell me what code to put where so multiple dropdown filters with title positioned inside have the same functionality as single dropdowns?

Thanks again!

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 4 months ago [\#206561](#206561) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206561 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")*

Hi,

As you put in your last message, the class hikashopMultipledropdownClass extends from the class hikashopSingledropdownClass
So this means that it does the same processing by default.
You can see that the only thing that changes is the multiple parameter which is added to the dropdown to make it behave as a multiple dropdown but all the rest is the exact same.
So I don't see why it would work for single dropdowns and not for multiple dropdowns.
I don't think that you need to change any code.
I think that it must come from something else because the text "Select some options" is not in HikaShop by default.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile") Topic Author
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

11 years 4 months ago -  11 years 4 months ago [\#206575](#206575) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206575 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")*

> nicolas wrote: I think that it must come from something else because the text "Select some options" is not in HikaShop by default.

Correct, the text is inside the Chosen JS files /media/jui/js/chosen.jquery.js and /media/jui/js/chosen.jquery.min.js
It's a placeholder (placeholder_text_multiple) when no options are selected for a multiple select.
See here, this is one of the references I found: [ api.devtrac.org/api/devtrac/libraries!ch...options.html/7.x-1.x](http://api.devtrac.org/api/devtrac/libraries!chosen!options.html/7.x-1.x)

> nicolas wrote: So I don't see why it would work for single dropdowns and not for multiple dropdowns.
> I don't think that you need to change any code.

Sorry, but it does require different code than single dropdown. For single dropdowns the default placeholder is placeholder_text_single = "Select an option" (singular). Obviously, you are replacing that with filter_name, but since it requires different code for multiple drop downs and the placeholder, it doesn't work the same way. So, simply extending the class doesn't work.

With the Chosen library enabled in HikaShop, I created two filters from the same custom field, one single, the other multiple dropdown. Please look at the different HTML and note the difference. I highlighted what is visible with dropdowns closed, and you see that for the single dropdown the placeholder was replaced by "Region (single)", and for the multiple dropdown it's not "Region" as should be, but it's still the default ("Select some options" as per Chosen JS):

**Single** dropdown:
[ ![chosen&#95;single&#95;dropdown.jpg](/forum/attachment/25232) ](/forum/attachment/25232 "...e&#95;dropdown.jpg")

**Multiple** dropdown:
[ ![chosen&#95;multiple&#95;dropdown.jpg](/forum/attachment/25233) ](/forum/attachment/25233 "...e&#95;dropdown.jpg")

Please look further into it and amend the necessary code to the classes/filter.php to make "Title position = inside" usable with multiple dropdowns and Chosen. Can't wait for a snippet... will be happy to be your guinea pig, haha!

Many thanks in advance!

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

- [ ![chosen&#95;single&#95;dropdown.jpg](/forum/attachment/25232) ](/forum/attachment/25232 "...e&#95;dropdown.jpg") [ ](/forum/attachment/25232?download=1 "...e&#95;dropdown.jpg")
- [ ![chosen&#95;multiple&#95;dropdown.jpg](/forum/attachment/25233) ](/forum/attachment/25233 "...e&#95;dropdown.jpg") [ ](/forum/attachment/25233?download=1 "...e&#95;dropdown.jpg")

Last edit: 11 years 4 months ago by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 4 months ago [\#206631](#206631) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206631 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")*

So it's chosen which adds that extra value with its javascript.

In that case, you want to change the line:
$multiple='multiple="multiple" size="5"';
to:
$multiple='multiple="multiple" size="5" data-placeholder="'.$filter-&gt;filter_name.'"';
in the file administrator/components/com_hikashop/classes/filter.php
That will add the filter name as placeholder in the select so that chosen can use it instead of the "select some options" text.
Let us know how it goes. And if it works fine without chosen, or with the other title positions. If yes, that's something we could add by default to HikaShop.

The following user(s) said Thank You: [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile") Topic Author
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

11 years 4 months ago [\#206659](#206659) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Replace "Select some options" with filter name?](/forum/45-filters-search/877828-replace-select-some-options-with-filter-name#206659 "-- url of the page with the problem -- : local -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.3  Hi,  I have several dropdown filters, all with title position = inside, to save space. One is single dropdown, and the title (= filter name) indeed shows inside. Several others are multiple drop downs (typical setup as per attached screenshot), but instead of the titles there's &quot;Select some options&quot; showing for all of them, making them all look the same. Only if you click on one, the title shows in the first row of options.  See here when closed:  See here when opened:  How can the filter title/name be displayed instead of &quot;Select some options&quot;?  (&#91;strike&#93;I have Chosen library enabled, and it seems to require a hack of a JS file. I'm not afraid of making the change along with note to myself for updates, but I suffer from lack of JS coding capabilities... so, I guess I'm asking you kindly to tell me what to change exactly.&#91;/strike&#93; Thanks!)  Edit: See update in next post.")*

:woohoo: YESSSSSS!!! Thank you, thank you!

So glad it works, because with Chosen the selects and dropdowns look already better than the usual pack out of the box, consistently across most browsers, and can further be styled. And the titles inside make real good sense, look even better, and save space, too! Thanks a ton for the quick and good fix! If it doesn't do anything bad to the "non-Chosen" elements, please leave the code in so others benefit as well.

Hmm, guess the only other option would have been to disable the "Title inside" button if multiple dropdowns and Chosen are chosen..... haha, just kidding.

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzgyOC1yZXBsYWNlLXNlbGVjdC1zb21lLW9wdGlvbnMtd2l0aC1maWx0ZXItbmFtZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.078 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
