Skip Navigation

[Gelöst] Reflect post relationships in breadcrumbs & permalinks

This support ticket is created vor 6 Jahren, 5 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 4 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 6 Jahren, 5 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#914104

Say I have the following post relationship structure:

-Boat
--Maintenance Tasks
---Log Items
--Safety Checks
---Log Items
---First Aid
--Documents
--Crew Members
---Certificate

I need to reflect this structure in my permalinks. So for example, I have a log item named "Check 10/11/2018" that was a child of a maintenance task named "Check engine" that is a child of a boat named "Albatross":

URL needs to be: example.com/albatross/check-engine/check-10-11-2018

Breadcrumb needs to be: Albatross > Check engine > Check 10/11/2018

How would I achieve the above structure?

Thanks in advance!

#914209

In permalink this is not possible, it'd require elaborated Custom Code.

For breadcrumbs, this would work if you have some nested Views, displaying for example posts belonging to the current post, as links.
But it is an overkill to use Toolset Views to output a simple "breadcrumb", but definitely possible by creating nested views:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

Breadcrumbs of the kind you use as "breadcrumbs" in the real sense, are not related to relationships but navigation.
For that, you can use YOASTs ShortCode which we integrate:
https://toolset.com/documentation/user-guides/views-shortcodes-for-other-plugins/

#914498

OK, sounds like I need to use views then. Is there a way that I can get that structure using nested views- no matter the post type currently being viewed? I say that because i'll be adding more post types and ideally need it to be dynamic.

I know I can get the post title using "A post related to the current post, set by a Types relationship" but I have to specify the relationship. Same goes for views- I have to specify the post type...

#914499

Perhaps a good starting point would be getting the ID of the "Boat" if i'm viewing a "Log Item"?

#914565

Hello,

Fro the question:
Is there a way that I can get that structure using nested views- no matter the post type currently being viewed?
No such kind of feature within Views plugin, when you setup a view, you need to select the post type and relationship filters for each view, in your case, different post type needs different view.