Skip Navigation

[Closed] 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by Jamal 3 years ago.

Assisted by: Jamal.

Author
Posts
#2004945
Captura de pantalla 2021-03-30 a las 11.19.18.png
Captura de pantalla 2021-03-30 a las 11.18.08.png
Captura de pantalla 2021-03-30 a las 10.57.15.png

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

Hi,

I have tried to do what you have told me but it has not been possible.

What have i done?
- I have created a view with block editor to inlcude, on field and text HTML mode, a shortcode with view name. i attach the settings of the view
- That view shortcode ([wpv-view name="mensaje-recibido"]) has the settings attached.

I created a 'Mensaje directo' page (hidden link) with this contact form: hidden link

But new page dont display on view who i created.

I need a filtered view of this custom types called 'Mensaje directo' so that the user who created the Enterprise page can see their received messages (pages which forms created).

I tried filter by author page = current author but that doesnt work because view tooks second author and not the original author (who created Enterprise).

Can you help me?
Thank you!

#2005249

Jamal
Supporter

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

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

Hello and thank you for contacting the Toolset support.

The block view needs to query the Enterprise custom post type, instead of the "Mensaje directo" custom post type.
https://toolset.com/wp-content/uploads/2021/03/2004945-Captura_de_pantalla_2021_03_30_a_las_11.18.08.png

And the other view needs to choose the correct relationship between the Entreprise and the "Mensaje directo" in the query filter
https://toolset.com/wp-content/uploads/2021/03/2004945-Captura_de_pantalla_2021_03_30_a_las_11.19.18.png

If you still have doubts with it, allow me temporary access to your website and let me check it. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2006203

Hi Jamal,
I have tried but I have not been able

Remind you that i want to show below 'Mensajes directos recibidos' on Area personal page (hidden link), the posts created with form (hidden link) on specific contact page (hidden link).

That view (and content created) only will display received messages. That message was created by form. Form was filled after visiting 'Ficha de empresa' custom type.

Example:

User A creates 'Ficha de empresa' page
User B clic Contact buttom on 'Ficha de empresa A' page
User B fills contact form and generates a new page: 'Mensaje recibido'
On Area Personal page, user A will see inside a new view 'Mensaje recibido' filled by user B.

There are differents users and pages, isolation is important because users only can see messages to theirs own pages.

Thank you!

#2008205

Jamal
Supporter

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

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

Would you allow me temporary access to your website to check this further. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2010395

Jamal
Supporter

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

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

Thank you, I confirm the credentials are working, but I am confused a bit. Can you walk me through the whole process?
- Where the expert reply to an enterprise?
- Where the enterprise should see the messages?

It would be very helpful if you explain the whole process in details, I am sure you will understand that we work on several customers websites and we can't be familiar with their website the way they are, plus the language barrier can also be very confusing:
1. A company is created here xxx
2. An Message to the company should be entered here xxx
3. The company should see the messages here xxx

#2010693

Hello Jamal,

Thank u for your supporting.

Okay, lets see. . . I will try to answer your questions:

[Can you walk me through the whole process?
- Where the expert reply to an enterprise?
- Where the enterprise should see the messages?

1. A company is created here xxx
2. An Message to the company should be entered here xxx
3. The company should see the messages here xxx']

Can you walk me through the whole process?
Yes, of course:

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.

#2010773

Jamal
Supporter

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

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

Thank you for these details, I understand the process better now.

It turns out that you don't have, currently, any relationship between the messages and the enterprises. Check the alert in this screenshot hidden link

You will need to do the following:
1. Create a One-to-Many relationship between the Enterprises and the Messages. One enterprise can have multiple messages.
2. Update the form to create messages, and include a relationship field for the parent enterprise.
3. Switch to the advanced mode and set the value of the field to [wpv-post-id].
4. Test the form, send a message, and check if the relationship link will be created for the message and its parent enterprise.
5. Update the "Mensaje recibido" view, make sure to choose the correct relationship in the relationship filter, and that the status filter is set correctly.
6. Include the view inside the Fields&Text block that I have added to the Blocks view hidden link
6. Check in the frontend if it is working as expected.

Let me know what you will get. If you get stuck, let me know at what step of the above.

The topic ‘[Closed] Show conditional content (only original author) on a view’ is closed to new replies.