Home › Toolset Professional Support › [Resolved] Hide Client post relationship from Project post editor using condition
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)
Tagged: Access plugin, Post-relationship, Types plugin, Views plugin
This topic contains 8 replies, has 2 voices.
Last updated by Minesh 5 years, 5 months ago.
Assisted by: Minesh.
Tell us what you are trying to do?
I want to hide/show the Client post type from Project post type editor if met all my condition. Like from my Project editor, maybe I will add a taxonomy (e.g. Show Client, Hide Client) or adding a check box from Project custom post field (Check / Uncheck to hide Client from front-end) that will trigger to show the Client post relationship in Project editor.
Why i want to do this is sometimes, other clients doesn't want to put there names but i don't want to delete them from Clients data. So maybe, adding condition to every post in Project editor to trigger to hide or show the Client will solve my problem.
I did try to search here but it seems most of the time its far from my needs.
My first trial was, in my Project post type settings. I uncheck the shown in post editor. But when I open 1 post from Project and check if the Client post relationship is gone, unfortunately its still there.
Supposedly my whole idea after unchecking the shown in post editor check box was to add a condition like what i mention above.
Is it doable with my situation?
Thanks
Hello. Thank you for contacting the Toolset support.
I would like to know - when you say post relationship - do you want to control the post-relationship box on the backend (admin) or on frontend? If its on frontend - do you want to control the post relationship-specific posts of specific post type?
Hi Minesh,
Both question seems Yes.
Because for my knowledge, i think if a custom post type is hidden from the backend post editor then it is hidden as well on front-end right?
But if possible that i don't need to hide the Client post relationship in my Project post type editor and just add some custom checkbox to trigger hiding the Client details from specific Project post on frontend that would be much better.
hidden link
here is my screen cast to show you what i am trying to say. For these example, i created a checkbox inside project custom field, but i haven't set the condition yet as i don't have any idea whats next.
Basically, as I understand, if the checkbox you made is checked we should display the client information on frontend otherwise not.
View's offers conditional shortcode [wpv-conditional] using which you can display the conditional output.
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
If you can share the access details, I can write the logic of show/hide based on the checkbox checked/unchecked.
Can you please share problem URL where you want to show/hide client information as well as access details.
*** Please make a FULL BACKUP of your database and website.***
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.
Ok, now comes elementor in the picture 🙂 - when you started the ticket you did not mentioned that you are using Elementor to build your template.
I see you created the template using Elementor here:
=> hidden link
Now, if you use elementor, there is no way to display conditional output until you build a content template using Toolset. I mean, you need to design content template using Toolset, where you should display the content and within that content template its possible to add the conditional statement.
Its possible to add a conditional statement using elementor's shortcode module but the thing is that on this page you are displaying client information with a template which is build using Elementor where you displaying the information in tabular format and where you need to hide the client row but there is no way to hide that specific row.
Here is the Doc - how you can use Elementor with Toolset.
https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/
Sorry about that i miss to tell you about elementor.
About what you've said, does it mean using shortcode of the client details doesn't work? Because my Elementor template is using dynamic shortcode. Every info on that project details has individual shortcode, its not actually a tabular format if im not mistaken correct me if im wrong. You can check from the Toolset Dashboard that i have a lot of Views for individual info.
Basically - you can use the conditional statement as given under which you can add it to your elementor's shortcode module or even to text module.
[wpv-conditional if="( '[types field='field-slug' output='raw'][/types]' eq '1' )"] Condition is True [/wpv-conditional]
I would like to know especially using what plugin you created the checkbox "Create activity tracking session for this post"?
More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
I did try to add conditional on clients name view
hidden link
and thses is my checkbox settings
hidden link
check or uncheck
hidden link
the result is always hidden
hidden link
seems im missing something.
About your question, im using the activity log plugin.
Actually, as you noticed, the following view is set to query the "Client" post type:
=> hidden link
The thing is that you are querying the view of "Client" post type and the checkbox is a part of the "project" post type. What you should do is actually:
- Create a content template and add the conditional shortcode with the view.
For example:
[wpv-conditional if="( '[types field='show-client-info-on-frontend' output='raw'][/types]' eq '1' )"] [wpv-view name="clients-name"] [/wpv-conditional]
Can you please adjust the code as above and try to resolve your issue.