Skip Navigation

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

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 – 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 5 replies, has 2 voices.

Last updated by avansisI-2 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1975597

Hello,

We come from: https://toolset.com/forums/topic/reply-a-custom-type-with-messages/ and https://toolset.com/forums/topic/send-page-title-to-next-page/

I have a page created with a post form, that post form obtains user data from a parameter URL from a custom page

Among that information that the form passes to the page, it is the user's email.

I would like that the author of the initial page, could see the page that has been created through him. But I don't know how to show that page created in the view. It could only be seen by the author of the original post (the owner of the email that I sent via the URL to the form)

<b>How it works now: </b>

User Leo creates the page Enterprise.
Inside Enterprise, que have a contact buttom.
Visitor clics on contact buttom.
Info passes to next page on param URL (ie: ****/?contact_id=1346).
Post form receive the info and include on the form the author info (info: author email).
When visitor submit the buttom, a new page is created (inside custom post type: Mensajes directos).
Page is created.

<b>What i need? </b>
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

#1975859

Hello and thank you for contacting the Toolset support.

You will need to have nested views, you can't get this with one view and some query filters. Unfortunately, nested views are not yet supported in the blocks editor. You will need to create these views with the legacy editor.

The first view will search for enterprise posts where the author is the currently logged-in user. Inside of the loop you put a view that will look for "Mensajes directos" with a query filter on the posts related to the current post in the loop(which is the enterprise post). Does it make sense?

#1979667

Yes, i think that it makes sense.

How i can create nest views?

Thank you!

#1979731

.

#1979747

Currently, the blocks editor does not support nested views. It will in an upcoming release when we'll offer to create views independently as we can with the legacy editor.

So, you will need to insert the "nested/child" view inside the parent view using a shortcode:

[wpv-view name="name of the mensajes view"]

To enable the legacy editor, go to Toolset->Settings->General(tab)->Editing experience, and enable both editors.
Check the example on this page hidden link

  • The first view is built with blocks within the page hidden link
    It has a query filter on the post author. Check this screenshot hidden link
    Notice how I added the second view using a shortcode inside the Fields&Text block. Check this screenshot hidden link
  • The second view has been created using the legacy editor hidden link
    It has a query filter on the relationship for the current post in the loop. Check this screenshot hidden link

Of course, you need to log in in order to see the results.
- Login using the demo user with the following link hidden link
- Login with another user using: john / john@toolset

I hope this answers your question. Otherwise, please elaborate more. At what point you are stuck on creating this nested view? Add screenshots when it makes sense.

#2004867
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

Hi Jamal,

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!