Skip Navigation

[Resolved] Custom Search Conflict

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to place a custom search View in my site. If I place it above another View, it will not work. If I place it below the same View, it will work.

Solution: There are two separate issues here.
1. You cannot place a custom search View inside the Search and Pagination panel of another View, in most cases. This will result in a nested form tag, which is invalid HTML. You must choose the option "Disable the wrapping div around the View" for the nested View if you want to nest a View in the Search and Pagination editor area.

2. The HTML markup structure for the loop is broken. Be sure to close out the div in the third loop index when wrap=3. The code syntax highlighter will complain about this, but it's actually correct in this case.

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

Last updated by ericW-8 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1241905

I am trying to:
Add a view to a layout with a Custom Search

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

I expected to see:
When I place the Custom Search ABOVE the "Donna's Choice" view, it will NOT work;
When I place the Custom Search BELOW the "Donna's Choice" view, it WILL work.

The Custom Search works fine with the view "Basic List".
I'm sure there is a conflict in the Search and "Donna's Choice" View but cannot find it.

Instead, I got:
A Custom Search and View which are incompatible in the format I need.

#1241913

There appear to be at least two different problems here.
1. There is invalid markup in the Custom Search View. If you check the Loop Editor, there is a missing closing div in the pad-last item, to close out the row. Your code is this:

		[wpv-item index=pad-last]
			<div class="col-sm-4"></div>
		</wpv-loop>

It should be this:

		[wpv-item index=pad-last]
			<div class="col-sm-4"></div>
                </div>
		</wpv-loop>

You'll see that the code syntax highlighter thinks this is wrong, but it's actually correct in this case. There should be a closing div tag to close the row in index=3 and another closing div tag in index=pad-last, to handle the case where you need to pad out the last element.

2. It looks like you've placed a View inside another View's filters. In Donna's Choice, you've got this View included in the Search and Pagination panel:

[wpv-view name="taxonomy-image-search"]

This is a problem because the Donna's Choice View contains custom search elements. The taxonomy image search also contains filter shortcodes. This will result in an invalid markup structure, because you cannot nest form tags in HTML. If you really want to nest the taxonomy image search View inside Donna's Choice filters, you should choose "Disable the wrapping div around the View" inside the taxonomy image search View. However, I'm not really sure what you're trying to accomplish here because I can only see the results and not the filters.

#1242216

I appreciate your quick, concise response.