Skip to content
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

Post Categories & Post Tags Blocks don't work when inserted into Page #34212

Closed
2 tasks done
maddisondesigns opened this issue Aug 21, 2021 · 5 comments · Fixed by #35957
Closed
2 tasks done

Post Categories & Post Tags Blocks don't work when inserted into Page #34212

maddisondesigns opened this issue Aug 21, 2021 · 5 comments · Fixed by #35957
Assignees
Labels
[Block] Post Terms Affects the Post Terms Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@maddisondesigns
Copy link

Description

The Post Categories & Post Tags Blocks don't work if you insert them into a page.

After adding either of these blocks into your content, you simply get a spinning icon and nothing else. Since I presume these blocks are designed to only work with Post Categories & Tags (based on their name), then they should, at the very least, show a message to the user that they wont work within a Page, instead of simply showing a spinning icon like they're trying to do something.

Vid: https://share.getcloudapp.com/Qwu50JOL

Even after saving the page, and reloading it, the blocks still display a spinning icon.

screenshot_145

Step-by-step reproduction instructions

  • Create a new Page
  • Insert the Post Categories and/or Post Tags block
  • Watch the spinning icon

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 5.8
No Gutenberg plugin active
TwentyTwenty
No other plugins active
MacOS BigSur 11.4
Firefox 91.0.1

Pre-checks

  • I have searched the existing issues.
  • I have tested with all plugins deactivated except Gutenberg.
@carolinan carolinan added the [Block] Post Terms Affects the Post Terms Block label Aug 22, 2021
@Humanify-nl
Copy link

Humanify-nl commented Aug 28, 2021

I'd propose a feedback message such as: This block needs post terms to work, please add them here (+ link)

Pages can have post-terms but are not present in vanilla, they need to be added by a theme developer.

Best case would be to automatically remove these type of blocks from the editor when they do not fulfill the requirements for a certain post-type. As is talked about here: #30679

@maddisondesigns
Copy link
Author

Agreed. The best solution would be to not allow a user to insert them into content where they're not going to work, such as on Pages.

@maddisondesigns
Copy link
Author

@carolinan Looking at #35957, does this actually prevent the user from being able to insert this block into a page? If not, then what is the point of this change? Replacing the spinner image with "No tags. No categories" is not much of a fix. It's also not much of an explanation to the user. What is the point of allowing someone to add this into a Page, if it's not going to work? Gutenberg shouldn't show this block in the Inserter if the current post (i.e. Page) doesn't have Tags or Categories (which is the default for WP Pages).

@carolinan
Copy link
Contributor

The point is that the block will not look broken. If no tags are found, it displays that no tags are found, not why they are not found.
I don't think that disabling blocks depending on post type makes it easier, but more confusing, for the user.
If the block was not enabled on pages it would not be possible to combine static content and a query on a custom front page.

@Humanify-nl
Copy link

I agree with Carolina here. We are approaching a full site editing experience where blocks need to be available everywhere in the default core experience.

The solution to display 'no tags are found' gives the user all knowledge they need to understand what is happening and what this block is for.

It is quite easy for a theme developer to disallow access to certain blocks on a post-type basis, if this is necessary. But we're talking here about the default start situation that new WP users get in front of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Terms Affects the Post Terms Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants