Skip Navigation

[Resolved] Option List styling, different style for sub-options

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by AnjaK9022 6 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#912949
bessere-darstellung-suchliste.png

Tell us what you are trying to do?
I want to style the multiple select options a little differently. I would like the top options to be bold and replace the "-" in front of the sub-options with a list bullet or something like that. Or at least add a space after the "-" --See Screenshot attached.

Is there a similar example that we can see?
https://stackoverflow.com/questions/32764493/how-to-add-sub-item-in-drop-down-list

What is the link to your site?
hidden link

#913252

Hello,

I assume we are talking about the shortcode [wpv-control-post-taxonomy] in Views custom search form, see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy
there isn't exact option to achieve what you want:
I would like the top options to be bold and replace the "-" in front of the sub-options with a list bullet or something like that.

But you can add a space after the "-", by setup the attribute "format", for example:

[wpv-control-post-taxonomy format=" %%NAME%%" ...]

There is a space before the %%NAME%%

#913321

Hi Luo, thank you very much for the quick reply. Adding the extra space works.
Too bad I can not add any other styling. Maybe you could think about adding some css classes to sub-items in future releases. Or would that NOT make sense?

<option value="mainoption" class="mainoption"> Main Option</option>
<option value="suboption1" class="suboption"> Sub Option</option>
<option value="suboption2" class="subobption"> Sub Option</option>

Thanks again and I guess we will just have to live with it then. I thought there might be a way by using a script in functions.php to change the output.