Skip Navigation

[Resolved] I distributed 20 checkboxes of a View Search Field into rows and columns -issue

This support ticket is created 3 years, 10 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 3 voices.

Last updated by blazM-4 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2011081

Tell us what you are trying to do?
I wanted to format my 20 category checkboxes (CBs) into a grid using Kadence theme Row blocks. I did this by splitting HTML and putting the checkbox/label/input HTML parts into row/column blocks, with icons to mark each of the 5 rows.

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
You can see the central part of the page at hidden link
The checkboxes work and the values are correct, we store them with Refresh into cookies, etc. But the View Output is affected only by the first group of 5 CBs (which I have not modified) and the second group of 20 does not affect the selection. The English version has 3 calls only but already the issue can be seen. There's /sl/calls version with more calls.

What is the link to your site?
hidden link

#2011111
Screen Shot 2021-04-05 at 1.44.26 PM.png

Hello, it sounds like you have a custom search View with checkboxes filters. Some of the filters are not working as expected after moving some of the checkbox filters into different areas by manipulating the generated HTML. I'll be glad to take a closer look but I see a 404 error when I visit these URLs:
hidden link
hidden link

Do I need a login or something else to access the /calls page? I am activating private reply fields here so you can share a login if necessary.

#2011199

I am sorry the site is on .eu so: hidden link

#2011317
query-filter.png
block-navigation.png

Okay thanks, I am able to see the customized filters in both of these pages:
hidden link
hidden link

Since you have added Category checkbox group filters manually with HTML in the Block Editor, the View's filtering system does not know to expect Category checkbox filter criteria during a search. Normally when you add those filters using the Block Editor the View is automatically updated to expect those search criteria. You should add a Query Filter for the Category taxonomy in the Block Editor to try to solve that problem. Select the top-level View block in the Block Navigation outline, and open the Content Selection panel (see the screenshot block-navigation.png). Add a new filter based on the category taxonomy, and configure it to respond to the URL parameter wpv-category. See the screenshot query-filter.png for an example - my taxonomy is called "Book Taxes" but yours will be "Category".

This Query Filter configuration should enable the custom checkboxes filters you have implemented for Category filtering. Let me know if you have questions about that.

#2011873
Archive Fields.jpg
Archive Add Filter.jpg

Hi, Christian, your suggestion seems very good and inspiring, but maybe I forgot to mention I was doing this in a CPT Archive, so the Object to use could not be View. I still tried the same with the Archive object, but the parameters seem different. I tried to reproduce your suggestion as close as possible, but it didn't work.
I chose Add filter, but the only field I could choose was "Custom field categories" (image 1) and then the form you can see in the screenshot (image 2).
Pls, suggest ...

P.S. Maybe I should mention that I "developed" the input-checkbox HTML in a View on a page and then transported it into the Archive. I did however insert a regular category taxonomy search field in the Archive first and then I took all the HTML around the checkboxes and inserted the rows/columns checkbox code in that. Needless to say, I am willing to reproduce all of it according to any suggestion you could provide.

#2012719

I realised that the problem I may have is that I was hoping to be able to wrap the blocks with the divs using one HTML block at the beginning and one at the and. I found out this does not work. So this may be the issue.
I learned that using a group block that can be achieved and adding some custom classes to the blocks CSS.

What class would I need to add to the wrapping div for my checkboxes to work?

This is what I coped from the original Toolset HTML for the beginning of the search field:

<div id="bam-cats-input" class="wp-block-toolset-views-custom-search-filter wpv-custom-search-filter wpv-custom-search-filter-label-top" data-toolset-views-custom-search-filter="977618b775a7eef8cf3c604b14ece494" style="user-select: auto;">
	<div style="user-select: auto;">
		<div class="form-group" style="user-select: auto;">
			<span class="wpv-custom-search-filter__input" style="user-select: auto;">

1. The 1st div seems most important, I just added the id for programmatic use.
2. 2nd div can be dropped, I assume.
3. 3rd div? Could that class be added to the first one?
4. This span seems to be needed, just wonder if I can change it to div, especially if many more divs are wrapped inside of it.

#2012753

I have now used the Container block to create the wrapper, assigned it the div type and in the CSS classes copied all from 1., 3. and 4.

It is all good and stable, but the search still doesn't work, well makes sense, since actually I cannot reproduce the "data-toolset-views-custom-search-filter" attribute of the 1st div

#2014167

Can you help me, please? Maybe pointing me in the right direction here.

#2015301

Shane
Supporter

Languages: English (English )

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

Hello,

Christian is currently on vacation at the moment so I will be handling this thread for him.

I understand what you are trying to achieve with these filters here, however the problem seems to be that there is a disconnect between the actual filters and the query filter that would filter the view itself.

Would you mind allowing me to have admin access to the page so that I can have a look at the setup to see if I can provide any advice that can help to resolve this.

Thanks,
Shane

#2015419

To summarize:
1. I want to have the 20 checkboxes arranged in a grid (float:left) for responsiveness, including some icons. - hidden link

2. I split the checkboxes in rows using Kadence blocks

3. I tried to wrap them with custom HTML but that didn't work, so I did that with Toolset Container, with all classes in its <div> with id="bam-cats-input"

4. I can't do the view reference, I guess. "data-toolset-views-custom-search-filter=???"

5. I am willing to do it in any other way as long as this looks ok.

#2016549

Shane
Supporter

Languages: English (English )

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

Screenshot 2021-04-09 at 3.43.05 PM.png

Hi Blaz,

I tried looking at your archive in order to check on the issue but i'm seeing the following. See Screenshot

I've refrained from making any changes or edits as i'm not able to see all the customizations on my end.

Can you let me know if you're seeing this on your end as well ?

Thanks,
Shane

#2016559

Shane, this is a known issue, the conflict with JWT Auth plugin. I always have to turn it off. Doing that now, just reload.

#2017681

My issue is kind of resolved.

I found a workaround, may be useful to others with a similar challenge.

1. I noticed if I put the original categories taxonomy search field below(!) my organised checkboxes which have the same names, mine trigger the original ones if the latter are positioned after my grid.
2. This means the search works too if both are there.
3. I just added an ID to the original field and used CSS to hide it.

It works nicely but will need to manually update the organised checkboxes when categories are changed.