Skip to content

Turn A Row, Column or Block Into A Hyperlink #29136

@NigelRodgers

Description

@NigelRodgers

What problem does this address?

I want to make a whole column (or any Gutenberg element) to be a clickable hyperlink. I first encountered this challenge when I created a set of cards using Gutenberg columns. I wanted the cards to be clickable, but settled for adding a hyperlink to the heading and image of each card separately.

What is your proposed solution?

A function that dynamically wraps any Gutenberg element with anchor tags. Maybe the same as is currently on image, heading and paragraph tags.

A potential issue may be when a user tries to use this feature to wrap other hyperlinks. For example, if there is a paragraph with a link and the user tries to wrap it with a column that has a link. I could be solved by checking if wrapped items have anchor tags before allowing them to be wrapped in another link anchor tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ColumnsAffects the Columns Block[Block] GroupAffects the Group Block (and row, stack and grid variants)[Status] DuplicateUsed to indicate that a current issue matches an existing one and can be closed[Type] EnhancementA suggestion for improvement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions