Skip Navigation

[Resolved] Transitioning old search query to new, missing taxonomy query

This support ticket is created 3 years, 5 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 6 replies, has 3 voices.

Last updated by Michelle Dodd 3 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2098141

Tell us what you are trying to do?
I am trying to replicate the search functionality from this archive page: hidden link (password: health) to be on the homepage hidden link with results showing up on that same directory page, then the user can reset the search and start again. For now I set up this test page to demonstrate the functionality I want: hidden link
The results for the state is working, but not the EHR or PHM systems.

I created a view for the search but that may not be the right way to do it.

#2098813

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Michelle

Can you give an example of a search that doesn't work as expected? I'm not sure what to search for.

If I choose the PHC Location "Cloud Craft" on your initial archive page I get 1 result.

If I choose the PHC Location "Cloud Craft" on the home page, it redirects to the search result page with the same result.

If I enter the PHC Location "Cloud Craft" directly on the search result page I get the same 1 result.

I understand you've created a search View and split the results to show them on a different page, and superficially at least it appears to be working.

#2098853

{ticket status updated}

#2099489
Screenshot (275).png
Screenshot (274).png

Hi thank you for responding. It's actually the results that aren't returning the correct values (or any values for EHR and PHM). When I search for Alaska on the old and new searches, I get the correct HCCN (the main custom post type we're querying) and the PHC Location is correct for both. However, the "old" search hidden link (password: health) returns some results for the EHR and PHM, but the "new" search says "No EHR Listed" and "No PHM Listed" hidden link

I attached screenshots of the results for each. One thing I noticed is that in the old archive page, we were able to query by both Post and taxonomy (States Served) but I may be missing that piece on the new view.

#2101363

Thank you for sharing the screenshots and I see what you mean.

Can you please share temporary admin login details, so that I can see how these filters and the results are set up in the admin area?

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

#2103915

Thank you for sharing these details.

During troubleshooting, I noticed that in the view "Home Search" used on the homepage, the loop is loading the content template "Loop item in HCCN Directory" from the archive "HCCN Directory".

The relationship query filter in the views "EHRs list for HCCN" and "PHM list for HCCN Directory" doesn't work with the option "The post where this View is shown" because they are not placed in the content template of the view "Home Search".

To make this work, I added the following changes:

1. In the content template "Loop item in HCCN Directory" I passed the current HCCN post's ID in the shortcode for the views "EHRs list for HCCN" and "PHM list for HCCN Directory", through the attribute wpvrelatedto="[wpv-post-id]".
( screenshot: hidden link )

2. Next, in the relationship query filter for views "EHRs list for HCCN" and "PHM list for HCCN Directory", I changed the option "The post where this View is shown" to "The post with ID set by the shortcode attribute wpvrelatedto".
( screenshot: hidden link )

As a result, the "EHR" and "PHM" values are now showing correctly in the search results from the homepage's view too.

I hope this helps and please let me know if you need any further assistance around this.

#2104255

My issue is resolved now. Thank you!