Skip Navigation

[Resolved] Show conditional content (only original author) on a view

This support ticket is created 3 years 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
- 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 32 replies, has 3 voices.

Last updated by Minesh 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2027267
Captura de pantalla 2021-04-20 a las 11.48.57.png
Captura de pantalla 2021-04-20 a las 11.48.47.png
Captura de pantalla 2021-04-20 a las 11.47.27.png

We come from here: https://toolset.com/forums/topic/show-conditional-content-only-original-author-on-a-view-2/

Hello Jamal,

I'm stuck on step 5 of Jamal's message because I dont know how to set relationship filter (i attached an image with current setting).

I tried set up the relationship filter but page displays 'No items found' when i have been created two pages.

Can you help me?

Thank you.

#2030705

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and my apologies for the last reply, my teammate has assigned this ticket to me while I was on my off days.

To better assist you with this, would you allow me temporary access to your website to see what you have done so far for the first steps? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2031715

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

You did not actually pass the value to the relationship form for step 3. Use the value attribute, instead of the select_text. And we need to pass the entreprise ID to it. I suggested to use wpv-post-id shortcode, but that is wrong. We should use wpv-search-term shortcode to get the entreprise ID from the URL parameter.
You can also hide(display:none;), just like the email field before it:

	<div style="display:none;">
      [cred_field field='@ficha-de-empresa-mensaje-directo.parent' class='form-control' output='bootstrap' value='[wpv-search-term param="client_id"]']
	</div>

- https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-214940

Now messages will be correctly linked to the enterprise post in the one-to-many relationship, and we can use it in step 5.

I performed all the steps, but I still can't see the messages. I need to debug this further, and I need to switch the theme and disable plugins during my testing. Can you prepare a staging site and let me work on it? Or should I take a copy of your website and debug it locally?

#2032779

Hello Jamal,

Okay, thank you for your support.
Yes, you can take a copy of website and debug it locally.

Do you need a copy? Can you make a copy?
We have been using Duplicator plugin. Weebsite has installed Duplicator & Duplicator Pro.

Thank you

#2033281

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I just want to let you know that I am still working on this in my local copy. WPML is adding complexity to the problem, but I'll get back to you as soon as I have something to share.

#2035363

Minesh
Supporter

Languages: English (English )

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

Jamal is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

Can you please tell me what user I should use to login as User A and user B.

I checked on your site and I can see the One-to-Many post relationship is available: Fichas de empresas Mensajes directos
=> hidden link

I can see the "Contactar" bbutton on single post of "empresa", for example, with the following link where I can see you are passing the contact_id in the URL param.
=> hidden link

Once you clarify what user access details I should use as User A and User B, I will further investigate.

#2035677

Hello Minesh,

Okay, dont worry about Jamal's vacation.
I have not understood you.

Jamal was working about view on b2b page: hidden link

Users arrive to that form when clicking on contact button on enterprise profile
(ie: hidden link). Then, contact form will create a new page (on a Mensajes directos custom type form).

I am not able to view the messages created by external users (not registered users) with post form on the view of b2b page (hidden link). I created a view on the bottom of the page called 'Recibidos'. On that view, i want to show that pages created by users, but only on the users who created the enterprise page. (Author of hidden link only will see messages created with contact form to him).

Can u help me?

Thank you

#2035751
Captura de pantalla 2021-04-28 a las 18.00.27.png

I tried to set up view like image that i attached but only works if i select a page manually. So, it works partially

I need that company file (or company files) to be the one created by the user who sees the view.

We could pass that attribute by param url or something similar?

Thank you.

#2036625

Minesh
Supporter

Languages: English (English )

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

Can you please tell me to what view you added that filter for which you shared the screenshot.

As well as on what page you want to display the company file (or company files) to be the one created by the user who sees the view.?

Also, please share the user with which I can login and you added company file (or company files) for that user so I can further investigate.

#2036797

Hello Minesh,

Thank u for your supporting.

Okay, lets see. . .:

1. Registered user (user A) create a new 'Ficha de empresa' on: hidden link (ie: hidden link)

2. Different registered user (user B), searches 'Fichas de empresa' on hidden link and entry on it.

3. When user B clic on 'Contactar' button (Contact), page sends user to a new page: hidden link . Web sends via param URL the contact id of the 'Ficha de empresa' page ie: hidden link. We set up on: https://toolset.com/forums/topic/show-conditional-content-only-original-author-on-a-view/

4. User B fills the form on page: hidden link and a new page had created by form. (ie: hidden link) That page will show content filled by user B.

(Up to this point it's done)

5. User A will be able to see page created by User B because user A did create the page: hidden link. User A will be able to see the page created by user B on last view of B2B page (below Mensajes directos recibidos) (hidden link).

6. User A will see the page on a view and then he would reply message with a new form.

Tips: messages created by forms are using 'Mensajes directos' custom type.

I hope it helps.

#2037397

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing all required information but what I'm asking for is I want access details of User A and User B (I already have admin access).

So, I can run a test using User A and User B.

I have set the next reply to private which means only you and I have access to it.

#2037439

Minesh
Supporter

Languages: English (English )

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

is user "joseangel" is User A? then who is User B?

Can you please share both user A and User B login details. Then I will access the page as per User A and User B accordingly.

I have set the next reply to private which means only you and I have access to it.

#2040823

Minesh
Supporter

Languages: English (English )

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

contributor role does not have publish capabilities.

So, its better to have a Editor or Author role should be assigned to both User A and User B.

You first have to setup the correct structure.

I logged in as User B and visited the following post that is created by User A:
=> hidden link

Then, when I try to click on the button Contactar' button (Contact), I can see the blank page. I do not see any form to submit the message.
=> hidden link

Can you please make it working and make sure I should see the correct form that I should uses to submit the message. Lets move step by step.

Here is the Doc that I suggest you follow that should help you to correctly setup the message system and its associated forms correctly.
=> https://toolset.com/documentation/legacy-features/miscellaneous/how-to-create-a-messaging-system-with-toolset/

#2044515

Hello Minesh,

Okay, understood.

I change user joseangel role to new role called Externo to simulate external users.

Now its working correctly and user A and B can view the form after clicking on Contact buttom.

#2044529

Minesh
Supporter

Languages: English (English )

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

Can you please make sure that message send and message reply forms are also setup correctly.

Here is the Doc that I suggest you follow that should help you to correctly setup the message system and its associated forms correctly.
=> https://toolset.com/documentation/legacy-features/miscellaneous/how-to-create-a-messaging-system-with-toolset/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.