Skip Navigation

[Resolved] Text search keyword inside a post

This support ticket is created 5 years, 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 15 replies, has 2 voices.

Last updated by wilfredC 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1375065
f3.JPG
f2.JPG
f1.JPG

How can I make the text search function can search a keyword inside the post?

For example, In the "Pets Wonderland Outlet @ Mesa Mall Putra Nilai" have the "Dog Food" inside the single post, and I make the text search able to filter the post when I type "Dog Food".

The Dog Food info is from another CPT and has a relationship with this current post type.

#1375317

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand, you want to search within the post title of related post type using view - is this correct?

I would like to know how you are displaying the dog food with the screenshot you shared:
=> https://toolset.com/wp-content/uploads/2019/11/1375065-f2.jpg

Basically, you can build a custom search with views for the post type you set to query for that view. If you can share the problem URL where you added the view and access details to review your current setup. Once I review your current setup I will be able to guide you in the right direction.

#1376019
pet2.JPG
pet1.JPG
screencapture-smartheart-my-wp-admin-admin-php-2019-11-05-10_04_53.png

I am using the elementor pro to create the single store locator page, for the "Dog food" part I am insert the "Store Locator Product" view.

#1376059

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I understand that you created the "Store Locator Product" view to display the related post on a single post of post type stores.

It's not possible to apply Text search filter in that way, for instance, if you want to search for "Dog Food" the view should set to post type "Retailer Products".

If you can share problem URL and access details that will help me to understand how you set up the relationship and I will try to check if there is any possible workaround I can offer you. Please share all the required details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1376139

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately, the wp-admin access details you shared with me is not working. Can you please send me working access details.

Can you please send me the link where I can see the page that is shown in the following screenshot:
=> https://toolset.com/wp-content/uploads/2019/11/1375065-f1.jpg

I have set the next reply to private which means only you and I have access to it.

#1376871

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks, but again when I try to login hidden link using the access details you shared, its not working.

I've also checked with one of my colleagues and shared access details with him, for him as well, the shared access details not working.

Can you please send me working access details. I have set the next reply to private which means only you and I have access to it.

#1378805

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked but still, the wp-admin password is not working. This is really strange that I checked with one of my colleagues for him as well its not working. Can you please send me working wp-admin access details.

Please check the following line as well:
Can you please send me the link where I can see the page that is shown in the following screenshot:
=> https://toolset.com/wp-content/uploads/2019/11/1375065-f1.jpg

I have set the next reply to private which means only you and I have access to it.

#1379639

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks, finally access details are working now and I can login to wp-admin.

I checked on your install that you are many-to-many relationship implemented between "Store Locators" and "Retailer Products". There is no way to search the view by child post title in this case "Retailer Products" and display associated "Store Locators".

We are planning to implement the feature for filtering the views with the fields of related posts in the near future but there is no ETA on it.

However, as your requirement is to filter the products based on the "Retailer Products" post title. you can use the relationship filter. I've added the relationship filter to your view's "Search and Pagination" section as given under:

[wpv-control-post-relationship ancestors="retailer_product@store-locator-retailer-product.child>store-locator-retail@store-locator-retailer-product.intermediary" url_param="wpv-relationship-filter"]
<div class="form-group">
	<label for="wpv-relationship-filter-retailer_product">[wpml-string context="wpv-views"]Retailer Products[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" ancestor_type="retailer_product@store-locator-retailer-product.child"]
</div> 
[/wpv-control-post-relationship]

As you can see now: hidden link
- There is a select box available at top of your filter box where you can select the related post title and filter your posts accordingly.

#1396997
bar.JPG

Hi, I'm sorry for dragging your support too long.
I test the option box you create, it nice, but can you make the option box have a "typing search" method? What do I mean is we are going to have a lot of options(could be around 200 products) so the dropdown is very long, so for the user they can type the product name they want, then the dropdown filter out the related product.

#1397545

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The thing is that - you can not have a search box because you are allowed to display relationship filters in the following formats:
- Select dropdown
- Select multiple
- Set of radio buttons
- Set of checkboxes

There is no option to display it as search textbox. However, if you can share admin access details, I will try to check if I can share any workaround but there is less change but still, I want to give a try.

I have set the next reply to private which means only you and I have access to it.

#1397615

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Again - the access details you shared with me is not working at this end. I also checked with one of my colleague and for him as well access details not working.

Please send me working access details.

I have set the next reply to private which means only you and I have access to it.

#1398247

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

As you can see now, the second dropdown where there are too many options available, now you can search within that dropdwon and select the option.

I've added the following scrip to your view's "Search and Pagination" section

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"></script>

I've added the following code to your view's "Search and Pagination" section JS box:
=> hidden link

jQuery(document).ready(function($){
 
  $(".chosen-select").chosen({
    
    max_selected_options: 20
   });
   
});

jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.view_changed_form (object) The jQuery object for the View form after being updated
	* data.view_changed_form_additional_forms_only (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-form-view] shortcode
	* data.view_changed_form_additional_forms_full (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-view] shortcode
	*/
  jQuery(".chosen-select").chosen({
    
    max_selected_options: 20
   });
	
});

This is a workaround/solution I can offer you at the moment.

#1398357

yes, that what i want, can you do it on the cat,dog option as weel? (above the location option)

#1398367

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

can you do it on the cat,dog option as weel? (above the location option)
==>
Ok - just added there as well. Gald to help.

#1398521

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm it works at your end as well as feel free to close the ticket 🙂