-
-
Notifications
You must be signed in to change notification settings - Fork 10.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
After creating a new tag and requesting its collection page, Ghost returns a 404 | After update to latest Ghost release. #10433
Comments
This is expected behaviour for the v2 Content API which recent Casper versions use. Rendering empty tag pages and having those tags appear in sitemaps etc was a bug that's been fixed in the new API version - empty pages are not good for usability or SEO. |
In my use case this is a bug. One of the sites I run is for a music group, it has a tag for "Upcoming Events" in the nav bar that occasionally has no posts, but the custom theme in use still has a link in that tags page to another tag "Past Events". With this new behavior I would have to add the "Past Events" tag the the nav bar, but even then having the "Upcoming Events" link return a 404 is not a good solution when there are no upcoming events, I don't want to have to keep removing "Upcoming Events" from the nav bar and adding it back, that is confusing for users and site admins. |
@dlford if you need empty pages to exist you can set them up using the dynamic routing features https://docs.ghost.org/api/handlebars-themes/routing/ Rendering pages by default for tags with no posts is 100% a bug. |
@kevinansfield thank you for the suggestion, but using the dynamic routing features as you suggest is also broken by the new behavior. In my I still think this is a bug, but I'll agree to disagree that it's 100% a matter of opinion. |
@dlford please move this conversation to the forum as requested. Tags that don't have posts don't exist according to the frontend. This is intended, expected behaviour. If you have a problem you can't solve, then post on the forum about what it is you need to achieve and we'll help you find the right solution. |
Yeesh looks like this bug is triggered quite easily from my installation even if there's a page to display. |
@joallard You can get it to work by editing the routes file in the theme. I can't remember exactly how I did it because I ended up switching to Gatsby in the long run, but the info is here as previously mentioned: https://docs.ghost.org/api/handlebars-themes/routing/ |
@dlford Nope, it's a bug. When a tag is created and an article is present, the link is not 404. And before someone tells me to file a report: (1) I have a good dozen bugs and UX issues to take care of after install, and (2) STR is finnicky. |
I don't disagree with you, this was the reason I moved away from using Ghost, introducing breaking changes and calling them features makes me hesitant to update, and that leads me to find a new solution. Haven't looked back. |
the bug is still there, even when i create a new tag alongside a new post : |
@jimz-yucolab to be super clear the bug you've raised is totally different - it's an actual bug with tags that should have URLs 404ing incorrectly. Whereas this issue is about a breaking change we made based on feedback we got from our users where tags (and authors) that had zero associated posts were not given URLs until they had at least one post associated with them. |
Issue Summary
In an older version of Ghost after creating a completely new tag, an automatic collection page was created with all the posts that were tagged with this particular tag.
If the tag that was just created didn't have any posts with it, the URL would still render correctly but without any tagged posts (200 - OK, successful).
After updating to the latest release I noticed that when you create a new tag and try to access the tag page, Ghost returns a 404 error. When troubleshooting I realized that after tagging any of my current posts with that new tag, only then the tag page rendered correctly.
I believe this is a bug and if implemented intentionally, it only serves to cause confusion with Ghost users.
To Reproduce
-- Continues:
5. Tag an already published post or publish a new one with the newly created tag.
6. Use a browser to access the tag URL.
7. Receive a 200 (OK.)
-- Reproduce Again:
8. Delete the tag from the published post and re-publish it without the newly created tag again.
9. Use a browser to access the tag URL.
10. Receive a 404 (Page not found.) -> Although tag does exist in Ghost admin panel
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
I consider this to be a bug as the behaviour when creating new tags in Ghost before was different and made more sense.
Sometimes I think that the users of Ghost want to create a new (empty) tag collections page without any posts in it. This is because after creating a new tag and the page, one may want to include it in the navigation for testing purposes (design-tab in the Ghost admin panel) before the initial post with this tag has even been published. Currently it will just return a 404 error although the post collection page should already exist. I believe thus that this is a bug.
I think the older behaviour with Ghost rendering an empty tag page is the way to go but this is just my opinion. Your thoughts?
Technical details:
The text was updated successfully, but these errors were encountered: