-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation block: unable to add CPT archive page as link #39644
Comments
@bradley2083 Would you be able to share the code you're using to register the CPT? If you're using a plugin for that, then maybe don't worry so much. |
No problem @talldan here it is...
|
Thanks, I'll give this a test a little later. |
Thanks for taking a look. The old menu system had a clear way to choose a
post types archive page for a menu. It seems odd this isn’t included at the
moment. It almost seems like there needs to be a way to create placeholder
pages like you would for “shop” if using Woo or “blog” for a posts front
page for CPTs so the page wouldn’t have any content functionality but would
then populate when searching “cpt_archive_name” etc.
…On Wed, Mar 23, 2022 at 11:40 PM Daniel Richards ***@***.***> wrote:
I gave it a test, and I see what's happening. As you mention you can add
individual courses. The search system doesn't really support searching for
a single custom post type, the same as searching for 'post' doesn't only
show posts.
Something I'd recommend doing is adding item_link and
item_link_description labels to your CPT. When you do that there will be
a block variation for courses available in the main block library (here
I've called it Course Link):
[image: Screen Shot 2022-03-24 at 1 36 13 pm]
<https://user-images.githubusercontent.com/677833/159849593-6b25b57b-ff10-4980-9bc4-16b81ee50f15.png>
Adding that variation of the block will limit the search to just courses.
It's not the easiest system though, it's still a bit hard to insert blocks
into the navigation block using the main block library as you need to have
another Link block selected. I think there needs to be a better way to
filter the search results.
—
Reply to this email directly, view it on GitHub
<#39644 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANS32RWB4KM6WJLETX4I43VBP543ANCNFSM5RLMB4UQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I see, sorry, for some reason I missed that it was the archive page you were looking for. Re-reading now, you did mention it, so my mistake 🤦 That is indeed something you can't do from the search. The only option is to add is as a a custom link. I'll relabel this as an enhancement request as that might be worth supporting. |
Custom post types are a cornerstone of WP. I'd be baffled if its not worth supporting. Let me add here for your test, that adding it as a custom link breaks the 'is-current-page' 'is-current-menu-page' markers. |
They deprecated the customized navigation area, which would allow the use of the legacy menu manager and proposed the navigation block that loses the ability to add CPT's, which, as already mentioned, is the foundation of WP. I sincerely hope that Wordpress continues to evolve, but a block that still doesn't cover the basic capabilities of the Legacy Menu Manager is making it difficult. The way will be to create a template for the CPT archives. With that it will appear in the insertion of menus? |
I’m sure they will get it right. Navigation is one of the most important aspects of a website.. But right now we’re either forced to used it as is, or drop the FSE (baby with the bathwater). That is why I proposed this: #39857 |
The ability to add CPTs isn't lost. You can still add CPTs. Currently there isn't a way to add the CPT Archive in the way the old menu system supported, and that's what's being discussed here. Please do make a seperate issue if you're having problems with links to individual CPTs. |
Hi, |
bump |
This issue was reviewed in today's Editor Bug Scrub. We have been able to replicate using the latest versions of Gutenberg and WordPress. |
+1 on this one, definately needed. just have to build custom links now for this. |
Have the same issue, need a fix |
Description
I have a "Courses" CPT and I'm unable to add this to a navigation block when simply search for "courses" as you can if you say want to add a Blog link (assuming that is your posts front page).
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: