Skip to content

Consider adding a general purpose Link block or block supports #62262

Open

Description

To my knowledge it's not currently possible to build a section like this (from this site) in a block theme:

Screenshot 2024-06-04 at 15 11 59

You can get tantalisingly close using the following structure and setting the Cover block to Use featured image and giving it a gradient overlay.

Query Loop
  Post Template
    Cover
      Title
      Excerpt

The problem is that you can't make the Cover block link to the post.

It would be great if there were a way to achieve this. I'm not sure of the best solution, but two ideas:

  1. A general purpose Link block which wraps its contents with an <a> and so allows you to turn anything into a link. This could even replace the existing Link to post and Link to home settings that exists in the Post Featured Image, Post Title, and Site Title blocks. We would need a way to restrict the user from nesting <a> tags though as this is invalid markup.

  2. Add a new Link block supports that shows up as a panel in the block inspector and add it to lots of different blocks: Cover, Group, Image, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Needs DesignNeeds design efforts.Needs design efforts.[Block] CoverAffects the Cover Block - used to display content laid over a background imageAffects the Cover Block - used to display content laid over a background image[Feature] BlocksOverall functionality of blocksOverall functionality of blocks[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)Link components (LinkControl, URLInput) and integrations (RichText link formatting)[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Type] EnhancementA suggestion for improvement.A suggestion for improvement.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions