Skip Navigation

[Resolved] Conditional breaks view grid

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Minesh 5 months, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2707031
3.PNG
2.PNG
1.PNG

Hi,
following this question here https://toolset.com/forums/topic/exclude-payed-member-subscriptions-from-toolset-search/, the new views that are conditional (if one is member show x view, if not - show y view) work, but break all grids.

I tired css to fix them with code. So far the problematic one is "search results", where I have pagination. The container shows single column and when I edit it for 4 columns, the pagination breaks the columns halfway.

No matter what I change in the view, the outcome stays single column.

#2707108

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

First of all, we publish hotfix version for many Toolset plugins:
- https://toolset.com/2024/07/toolset-1-6-16-essential-updates-for-wordpress-6-6-and-better-workflow/

*** Please make a FULL BACKUP of your database and website.***
Cam you please update ALL Toolset plugins to it's latest official release version and check if that help you to fix the issue.

More info:
- https://toolset.com/faq/how-to-install-and-register-toolset/#automatic-update-requires-registration

If no:

Can you please share problem URL and admin access details and tell me on what page you added both conditional views?

I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2707186

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see the view "search-payed(9218)" is looks like the following:

[wpv-view name="search-copy-1720007980"]

It seems the view you created is corrupter. What if you try to create a brand new view and then try to add that view to your page - does that works and do you see styles working with that view?

#2707211

I've created a new payed view.
Added it to "ct-for-views-as-container-search" - the grid is still single column.
Tried putting the view(no conditional shortcode) - view grid works.

The conditional group somehow resets all styles of the view, since all three groups I use, turned into single column.

#2707223

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please create two test pages:
- page where gird works
- page where grid does not work

Also, I see you must have created the view from the existing view as when I try to add the newly created view "search-payed-new" - I can see the followinging:

[wpv-view name="search-copy-1720608597"]

What you should try to do is:
- hidden link

From the above page, what if you try to click on "Add New" button can create the view and then build the loop output using Block editor.
OR
Create a brand new view by adding a view block and then try to build the view.

#2707249

1. I've made a completely new view - Search-results-clean-payed.
Added only it to the shortcode - the view is still single column when should be 4 columns.
2. Made the new pages - the view (hidden link, working) and the shortcode (hidden link, not working)
3. The view is not linked to any CSS, it's completely clean.

#2707776

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now:
- hidden link

To the above template I've added the shortcodes as given undere:


[wpv-conditional if="( '[is_pms_member]' eq '1')"]
 
[wpv-post-body view_template="search-results-clean-payed"]
 
[/wpv-conditional]

[wpv-conditional if="( '[is_pms_member]' ne '1')"]
 
add view for non payed users here
 
[/wpv-conditional]

I can see the grid works on frontend:
- hidden link

What you should do is:
- Create content template and add your view block for payed users which you already did it here:
=> hidden link

Now, create another content template "search-results-non-payed" and add your view block for non payed users and add the content template like I've added as you can see with the above.

So the final content template code should be:

[wpv-conditional if="( '[is_pms_member]' eq '1' )"]
[wpv-post-body view_template="search-results-clean-payed"]
[/wpv-conditional]

[wpv-conditional if="( '[is_pms_member]' ne '1' )"]
[wpv-post-body view_template="search-results-non-payed"]

[/wpv-conditional]

Do you see it working as expected now?

#2708718

Thank you, it's working correctly now.