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

Limit where the more block can be inserted #61128

Open
carolinan opened this issue Apr 26, 2024 · 3 comments
Open

Limit where the more block can be inserted #61128

carolinan opened this issue Apr 26, 2024 · 3 comments
Labels
[Block] More Affects the More Block - used for displaying the 'Read More' link [Type] Discussion For issues that are high-level and not yet ready to implement.

Comments

@carolinan
Copy link
Contributor

Description

The more block is the block version of the <!--more tag and if I understand correctly it only works if it is placed in the block editor, in the post or page content.
Code reference
Codex

Here are some examples of how themes in the theme directory use the more tag:
https://wpdirectory.net/search/01HWCBQ0RDFYTFCV7PHDB6X9K9
It seems to be exclusively used for custom excerpt functionality.

I feel that the open issues for the more block and the read more block shows that these blocks are easily mistaken for the other, and I wonder if this block should be limited to the block editor/pattern editor and not be placeable in templates.

It would reduce (but not completely remove) the risk that the more block is added in a query loop where it does not do anything.

Is there any other way to prevent it from being added inside a query?

Step-by-step reproduction instructions

If you wish to test if the block does anything in a template, just add it to any template and view the front.

If you wish to test how it works, then add the more block to a post, add some content before and after it, and set the query loop to display the post content. It does not work with the post excerpt.

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

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] More Affects the More Block - used for displaying the 'Read More' link [Type] Discussion For issues that are high-level and not yet ready to implement. and removed [Type] Bug An existing feature does not function as intended labels Apr 26, 2024
@richtabor
Copy link
Member

I wonder if the "Read more" block should be called the "Post link" block; that would reduce confusion as well. It will only render "Read more" if you don't change its content.

Yes, the "More" block should probably only be insertable within post content.

@carolinan
Copy link
Contributor Author

Or we try to merge them into one but I don't know how that would work.

@richtabor
Copy link
Member

Yea I don't think that will work. More block is fundamentally different than just linking to the post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] More Affects the More Block - used for displaying the 'Read More' link [Type] Discussion For issues that are high-level and not yet ready to implement.
Projects
None yet
Development

No branches or pull requests

2 participants