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!
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/
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...
Perhaps a good starting point would be getting the ID of the "Boat" if i'm viewing a "Log Item"?
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.