Saltar navegación

[Resuelto] Search for posts related (many-to-many) to the post the search is embedded in

This support ticket is created hace 6 meses, 3 semanas. 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)

Este tema contiene 8 respuestas, tiene 3 mensajes.

Última actualización por Minesh hace 6 meses, 3 semanas.

Asistido por: Minesh.

Autor
Mensajes
#2703008

a.R

Hi 🙂

In a post, we want to display the sibling posts of that post.
(Additionally we want to display some more search options to the user.)

How do that?

#2703089

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi there

How to display sibling posts is described on this page: https://toolset.com/documentation/legacy-features/views-plugin/displaying-brother-pages/

That is written in the context of the legacy editor for Views, but the principle is the same if you are using the block editor.

#2703098

a.R

... and this works with many-to-many too?
What are gonna be the "parents" then?

Clearly on of the biggest disappointments we had in 10 years of toolset!

#2703111

a.R

This is sooo complicated - really BAD! 🙁

#2703318

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

The Doc shared by Nigel is correct to display the brother pages.

If you can share bit more information about your requirement I will better guide you in right direction.

Cab you please share what post-relationship you have with what post types and what exactly you want to display and where?

*** 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.

#2703426

a.R

Is it correct, that in Step 2 of that tutorial, view_template is not given as a slug , but as nice title ("Tutorials Sidebar Parent")?

#2703428

a.R

Now we have
1. The parent template: wert-vorlage-einzeln
Here should the brothers be embedded in.

> ...
> [wpv-post-body view_template="None"]
> ...
> [wpv-view name="impulse-in-wert-bruder"]
> ...

2. The brother content template: impulse-in-wert-bruder

> [wpv-post-body view_template="None"]
> [wpv-post-body id="$parent" view_template="Wert-Vorlage einzeln"] (We also tried it as slug. )
(Really the template of the PARENT? Isn´t that a circular relation?)

3. The view: impulse-in-wert-bruder

(We have to set the content type to the one we want to find in this search, right?)
Filter is "Parent is the current post in the loop"

> ...
> <wpv-loop>
> [wpv-post-body view_template="impulse-in-wert-bruder"]
> </wpv-loop>
> ...

Can you see the problem? Thank you 🙂

#2703436

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Well - just looking at shortcodes I can not say is there any error or not.

I will have to look at your post-relationship structure and need to check with what view you want to display what.

Can you please share problem URL and tell me what exactly you want to display and where using what content template and view.

*** 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.

#2703495

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

The wert post you shared: enlace oculto

When I checked in backend it has post-relationship "Impulse zu Werten" and it has two related posts.
- enlace oculto

If your aim is to display those two related posts, then I've adjusted the following view's output as given under and displayed the post link in view's loop template:
- enlace oculto
Where I changed the Query Filter to:

Nach Eigentümer der Beitragsbeziehung oder Wiederholfeldgruppe filtern
Beiträge in einer Impulse zu Werten-Beziehung auswählenthat are related to the Post where this View is shown.

I can see those to related post links under heading "Unsere Impulse zu diesem Wert":
- enlace oculto

You can add whatever fields you want to display to above view's loop template.

Can you confirm is this your expected results?

#2703549

a.R

YEAH - that´s it! With your help, it´s really EASY!

THANK YOU, Minesh 🙂