Skip Navigation

[Resolved] Link to Dropdown Selection

This support ticket is created 3 years, 7 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 3 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1762167
Link to Dropdown.jpg

Tell us what you are trying to do?
1,
We have a dropdown menu made with toolset that uses tags, portfoliobranches and portfolio categories.
The Dropdown works like it should.
But we have some text above it with declarations of our services for our customers.
We would like to link the headlines of our services to the dropdown menue below.

Lets say the user clicks on the headline "3D Animation" then the dropdown selection for portfolio categories should be selected with "3d Animation" - und show only this category.

Can you help me out with some code?

#1762337

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

I've checked your website and found a "Leistung" page ( /leistung/ ), but it is using text links for filters and not the select dropdowns.

To suggest the best way to achieve this, I'll need to see how this page is set up in the admin area. Can you please share temporary admin login details, along with the link to a page where this select dropdown can be seen?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1762591

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for sharing the admin access.

To link the click action of the headings, with the select dropdown for the "Kategorien" field in the view, you can follow these steps:

1. Please go to WP Admin -> Portfolio Items -> Portfolio Categories and copy the slugs of all the terms, for which a heading and description exists at the top, under the "LEISTUNG" section.
( Example screenshot: hidden link )

2. Add each slug, in the respective heading's CSS class field.
( Example screenshot: hidden link )

3. In the "JS editor" under the "Search and Pagination" section of the view "Branchen-Leistung", you can add some custom script that will get the term's slug from the heading's class and then select the respective option from the "Kategorien" field in the view's search form:


jQuery(document).ready(function(){
	jQuery('.iconlist_content_wrap h4.av_iconlist_title a').click(function(event) {
		event.preventDefault();
		var classList = jQuery(this).parent().prop('className');
		classList = classList.replace("av_iconlist_title iconlist_title ", "");
		if(classList) {
			jQuery('select[name="kategorie"] option[value='+classList+']').attr('selected','selected').change();
		}
	});
});

Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1763117

Hello Waqar,

thank you for your help, but I cannot open your screenshots here.
They load forever.

Thanks
Michael

#1763381

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

screen-2.png
screen-1.png

Hi Michael,

Please find attached the screenshots from the last reply:

- screen-1.png
( Example screenshot: hidden link )

- screen-2.png
( Example screenshot: hidden link )

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.