Skip Navigation

[Resolved] Created a simple custom search but it is not returning values

This support ticket is created 7 years 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 3 voices.

Last updated by Christian Cox 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#594372

I am trying to: Create a custom search

Link to a page where the issue can be seen: hidden link

I expected to see: search results

Instead, I got: No Items Found

#594419

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tom,

It seems that something is wrong with the search you created.

I created a new one and it is working, you can see the view here and then add it to the appropriate page
hidden link

Thanks,
Shane

#594506

Hi and thanks for the quick reply.

I am still not sure why my search view did not work but yours did but I will compare the 2.

1) I created a search and search results page here alone with a content template to show the results.
hidden link

But, when I first go to the page it shows all the records even when I do a reset, how to I fix that?

2) It is showing the first result as a blanks?

3) I am using BeaverBuilder to style the content template. I can see the content edits but any of the styling does not show up?

Thanks again!

#594520

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tom,

The issue was that I found this shortcode in the view.

[wpv-post-body view_template="Organization Template"]

It seems you might have added it by accident but I removed it and it works fine now.

Thanks,
Shane

#594835

Hi,

That takes care of problem 2) It is showing the first result as a blanks?

However problems 1) and 3) still exist?

1) I created a search and search results page with a content template to show the results.
hidden link But, when I first go to the page it shows all the records even when I do a reset, how to I fix that?

3) I am using BeaverBuilder to style the content template named "Organization Template" and assigned it in the View named "Fundraiser Search Test". I can see the content edits but none of the beaver builder styling show up?

I tried to edit the Loopout editor to get the Content template to work but I seemed to have made a mess out of it. Sorry, there is a learning curve to ToolSet and why I have been using other tools but really want to learn and leverage Wp-Types for my sites.

Thanks!

-Tom

#594927

Ok, I simplified my the pages to narrow down my next biggest issue with WP-Types and Latest Beaver Builder Version 2.0.2.1 and the latest Toolset.

My main problem is that I created a Single Page Content Template and assigned to the Organization CPT. I can view the page and see the custom post field content however no styling is showing. For instance I can bold a field title however changing the background does not display.

Here is the example page :
hidden link

The Content Template is called Organizations Single Page Content Template.

Thanks,

-Tom

#595693

Hi, Shane is on vacation so I've been asked to look into this ticket. I hope that's okay with you.

1) I created a search and search results page with a content template to show the results...when I first go to the page it shows all the records even when I do a reset, how to I fix that?
You need to use custom code to filter the search results. I can show you generally how to do this, and you can customize this to fit your search criteria:

add_filter( 'wpv_filter_query', 'drop_empty_search_query', 10, 3 );
function drop_empty_search_query( $query_args, $view_settings, $view_id ) {
    $ids = array(1, 2, 3, 4);
    if (in_array($view_id, $ids)){
      if ( !isset($_GET['wpv_post_search']) && !isset($_GET['your-url-param-1']) && !isset($_GET['your-url-param-2']) ) {
        $query_args['post__in'] = array(0);
      }
    }
    return $query_args;
}

Replace 1, 2, 3, 4 with a comma-separated list of View IDs where you want to apply this filter. Next, look at the long line that tests all the different URL parameters:

 if ( !isset($_GET['wpv_post_search']) && !isset($_GET['your-url-param-1']) && !isset($_GET['your-url-param-2']) ) {

The first parameter, wpv_post_search, should be included if you use the "Text Search" filter in your View. The following terms should be modified to match any URL parameters you want to include in your View. Add or remove as needed, using the format

&& !isset($_GET['your-url-param-n'])

I can view the page and see the custom post field content however no styling is showing. For instance I can bold a field title however changing the background does not display.
I see what you mean here. Let's try to narrow down the issue a bit and find out exactly where the conflict is occurring.
- Please temporarily disable all plugins except Toolset Types, Toolset Views, and Beaver Builder Pro, then activate a default theme like Twenty Seventeen. Test again to see if styles are showing up as expected. If yes, then please activate your theme and other plugins one by one until the conflict is revealed.

#595701

I don't mind if you jump in, I was wondering why it took so long?

For #1) You are telling me that the standard usability is to show all the CPT records by default and I need to create custom code to not show records until the user searches? That is backwards from all the other search functionality I have been looking at. Surely this is a mistake?

For #2) The styling not showing up with the BB integration. I disabled all the plugins except for BeaverBuilder and the ToolSet plugins and it still does not show the styling. To be clear, if I style text for instance change a word to bold that does show. However changing a background for instance does not show.
hidden link

I need to get this fixed for a client, hopefully the resolution and updates will not take as long.

Thanks,

-Tom

#595712

I created a fresh install with just ToolSets Types/Views/CRED and BeaverBuilder using the TwentySeventeen template no other plugins. Created a simple CPT with 1 custom Field. Built a Content Template as assigned to the CPT. Same issue, styling does not show.

If you show me how to upload I can send you a Duplicator extract.

-Tom

#595887

I tried creating a Single Page template for the CPT using BeaverBuilder Themer and it worked great (I can see all the styling). Which leads to me question why I need Toolset in the first place if it does not work on this simple use case?

I have posted this in other forums and FB areas also without much feedback which leads me to believe that people are not really using Toolset and Beaver Builder combination. With that said I did purchase a Lifetime subscription and this is a supported integration.

The amount of time between reply's is very frustrating.

Regards,

-Tom

#595912

That is backwards from all the other search functionality I have been looking at. Surely this is a mistake?
This is how WordPress is designed to work, and Toolset reflects this functionality. Consider, for instance, searching for results on a WordPress site without providing a text search filter. Go to a WordPress site's search field and submit empty text. You'll be directed to something like yoursite.com?s= and the results will be the same - no filters are applied, so all results are returned. You must add custom code if you want to modify that functionality.

The styling not showing up with the BB integration. I disabled all the plugins except for BeaverBuilder and the ToolSet plugins and it still does not show the styling.
We have noticed a compatibility issue introduced with the most recent BB release. Please take a look at the known issues page here for a patch recommendation and instructions:
https://toolset.com/errata/content-templates-built-with-beaver-builder-2-0-are-not-rendered-properly/

The amount of time between reply's is very frustrating.
I do apologize for the delay, this is not normal. We have a couple of supporters out right now so we're working through the backlog of requests as best we can.