I have created a view that displays weather reports using the region taxonomy for the current day. However if no reports are made for the day, I would like there to be text that says “No reports for today (possibly dynamic date).” What can I add to the shortcode to display the text if there are no available weather reports?
Another issue with my view is that I would like the search bar and datepicker shown below the reports. Will this require two separate views? How would I display no reports until it is searched?
Hello and thank you for contacting the Toolset support.
No need to have two views in order to place the search filters where you need them. Actually, you can't search a view using a search form from another view. The search form needs to be part of the view.
You can see all of the view settings by using the screen options button. Check this screenshot hidden link
The view has 3 editable sections:
- Search and Pagination
- Loop Editor
- Output Editor.
For your first question, you can customize what to display when no results are found in the Loop Editor section. The content needs to go inside the wpv-no-items-found shortcode. Check this screenshot hidden link
Regarding the placement of search form vs result sets, you can customize that at the Output Editor section. Check this screenshot hidden link
You can use your own HTML and shortcodes in all of the 3 sections.
Currently using Divi code blocks to display the 2 taxonomy posts. In the gray sections, I'm trying to use [wpv-view name="current-weather-posts" wpvregion="pacific"] and [wpv-view name="current-weather-posts" wpvregion="Atlantic"] with the [wpv-filter-start hide="true"] to hide the search field and datepicker.
In the yellow section I would only like the search field and datepicker displayed, no posts until it is searched by viewer. As you can see, the post with a publish date of today is still displayed using the same view and shortcode [wpv-view name="current-weather-posts" ]
Jamal is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.
As I understand, you do not want to display any results under yellow section until the search if performed. If that is true, you will require to use the view's filter hook: wpv_filter_query
Thank you, Minesh. That custom code worked in hiding the results. While this code works, (Per Jamal - I would only need one view) so I need this same view to display the results (posts for the current date) in the gray section. What is the shortcode I need to achieve this outcome (please see reply for current shortcode used) ? Unless I would need to use a second view for the same post type, searching the posts not for the current date. hidden link hidden link
Please screenshot below for current search and pagination settings. When I press the “go” button, it is reloading the entire page and displaying results. Shouldn't my current settings avoid the entire page refresh? What can I changes can I make to avoid the entire page refreshing? hidden link
Glad to know that solution I shared help you to resolve your issue.
I'm not sure how exactly you added your views and where or what different sections or pages.
If you can share problem URL and access details and tell me what exactly you want to display what and where that would help me to guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
I’m noticing some issues. The changes you made have avoided a page refresh when I view the page in a Chrome browser. However, when viewing the page in the Safari browser, the page refreshes.
Regardless of browser used:
1. It isn’t pulling the correct posts. Whether I search via keyword or date, I am still receiving a “no items found” message or is blank.
2. “No items found” is also being displayed under the “current activity” section (using Safari)
3. Any secondary searches will not display any results.
What other changes can be implemented to resolve the issue?
The thing is that we have limited integration with Divi and we do not recommond to use ajax filters using divi as it may also result in losing styles etc..etc..
In addition to that, when you add the view as given under, as search form and search result, its not possible to use the ajax filters when using Divi.
If I search with keyword storm I can see it returns correct results, two in this case and if I search using keyword abc it returns not result and if also displays the message "No Items Found" that is added using the above JS code. Can you please confirm it works at your end as well.