Skip Navigation

[Resolved] Breadcrumbs from custom Post Type must use parents from pages

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

This topic contains 14 replies, has 2 voices.

Last updated by kristenM 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2567829
Parent pages and breadcrumbs.png

Tell us what you are trying to do?
I'm trying to use breadcrumb parents in a Custom Post Type created by Toolset.
When I use the list in breadcrumbs (Parents) on the Custom Post Type called "Manuals" and "Lifters" I only get to choose from the post that are located in this custom Post Type. I would like the ability also to choose from the posts in Pages.

Is there any documentation that you are following?
I have used Permalink Manager to custom the URL's but they don't give me the ability to change the breadcrumbs too.

Is there a similar example that we can see?
I have made a view in the attached image.

What is the link to your site?
hidden link
The breadcrumb should be: 2LIFT/ERGONOMICS/ERGONOMIC ASSESMENT TOOLS and point back to this page:
hidden link

but istead it is: 2LIFT/MANUALS/ERGONOMIC ASSESMENT TOOLS

Any idea how I can change that?
Thank you in advance
Kristen

#2568149

Hello,

The breadcrumb does not work with Toolset relationships.

I assume we are talking about one-to-many relationship between two post types "Manuals" and "Lifters".

In this case, you can switch to only one "hierarchical" post type, for example:
Create a custom post type:
- in section "Sections to display when editing ", enable option "Page Attributes"
- in section "Options", enable option "hierarchical"

It works just like built-in post type "Page".

More help:
https://developer.wordpress.org/reference/functions/register_post_type/#hierarchical

#2568379
Page atrtributes and hierarchical.png

Hello Luo Yang.
Thank yo ufor your quick reply.
As you can see in the attached image I have already enabled these functions.
I'm not quite sure that you have understood my problem so I'll try again.
I can only choose parents that are posts in the particular Post Type. I would like to use specific Pages as Parents.
This page : hidden link
should be parent to this manual: hidden link
How do I do that?
Best regards
Kristen

#2568939

As I mentioned above, breadcrumb does not support Toolset post type relationships, you can not use relationships in the breadcrumb.

For the question:
I would like to use specific Pages as Parents.

In this case, you will need to setup one-to-many relationship between "Page" and your custom post type.
https://toolset.com/course-lesson/using-post-reference-field-to-set-up-one-to-many-relationships/

#2569923
Relations created - still no Ergonomics Parent.png

Hello again.
I have now tried many to many relationsships and tried different approaces according to the course you mentioned and by looking at other posts about Toolset Relations. Please se attached image.
Unfortunately nothing works and I don't get to choose the Page "Ergonomics" as a Parent page.
Any other idea - or is it me that setup Toolset Relations wrong?

#2569935

Your screenshot isn't clear, here is a sandbox website:
hidden link

You can reproduce the same problem in it, and point out the problem post URL:
Where I can see "don't get to choose the Page "Ergonomics" as a Parent page"

#2569941

Hello again.
Wouldn't it be easier for you just to get access to the staging site I have. Setting up the environment in the sandbox would take a large amount of time I would think 🙂

#2571437

Hello again Luo Yang.
Before I set up an entire installation in the sandbox I would like to hear if I could allow you access to the staging site instead?
Best regards Kristen

#2571449
Sandbox Parents in Manual - no possibility for choosing Pages.png

Hello again Luo Yang.
I have tried to upload a copy of specific files to try and rebuild the situation and you can see it here:
Manual: hidden link
Page: hidden link
What I need to do in this setting is to use this particular Page as Parent for this particular Manual but as you hopefully can see in the attached image 🙂
How do I get this Page to act as a Parent (in breadcrumbs) for this Manual? It must be a solution that I can use overall on the site.

#2571731

Please check the sandbox website:
1) You are using custom reference field "Manuals to Pages":
hidden link
So there is one-to-many relationship between post types "Page" and "Manual"

2) You can connect "Manual" and "Page" posts manually, for example, edit below "Manual" post:
hidden link
In section "Manuals to Pages", connect it with other pages

3) In single page, you can create a post view:
- Query Manuals posts
- filter by post type relationship between "Manual" and "Page"
- In view's loop, display "Page" information
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

4) In single "Manual" post, you can display it's parent page information:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent

As I mentioned above, you can not use Toolset relationship in breadcrumb feature.

Toolset relationship is for connections between two different post types.
WordPress built-in "hierarchical" post type is for same post type, it works with breadcrumb.
They are different, so you can not select pages in the "Page attributes" section of your screenshot:
https://toolset.com/wp-content/uploads/2023/03/2571449-Sandbox_Parents_in_Manual_no_possibility_for_choosing_Pages.png

Hope it is clear

#2571801

Hello again Luo.
Thank you for your mail.
So, just to get it clear.
The one thing that I asked for (how to get Pages Post Types to be parents for Manuals Post Types) doesn't work with Toolset Relationships?
Then I don't understand why I should set this up?
What I don't understand is what I do about choosing different Parent Pages for Manuals?
I think we maybe have been talking in two different directions?
Best regards Kristen

#2571803

Toolset relationship is for connections between two different post types, it does not work with breadcrumb
WordPress built-in "hierarchical" post type is for same post type, it works with breadcrumb.

They are different things.

Which option do you want to go?

#2572249

Hello again Luo.
Thank you for your reply.
As I understand you Toolset Relationships doesn't support/work with Breadcrumbs and I need Breadcrumbs to work across Post Types.
How do I do that?

#2572477

You will need to consider option 2), you can convert those posts into one single "hierarchical" post type, see my answer above:
https://toolset.com/forums/topic/breadcrumbs-from-custom-post-type-must-use-parents-from-pages/#post-2568149

#2574845

My issue is not resolved but it doesn't seem to be something Toolset can help with.