Skip to content

[Component amendment]: Update Article block to support conditional metadata rendering (static & dynamic) #5779

@kim-isaac

Description

@kim-isaac

Component/pattern to amend

Article block

related pull request: canonical/ubuntu.com#16161

Context

Metadata within the Article block is defined as optional.

However, based on recent findings:

Dynamic mode: the Latest News module automatically populates metadata because the Article Block always creates the metadata slot.
Static mode: the metadata slot is still rendered even when no metadata is provided, resulting in empty space.

This creates inconsistency between expected behavior (optional metadata) and actual rendering.

Proposal

To address this, update the Article Block to conditionally render metadata is needed:

Dynamic mode: Do not create/render metadata container/slot if metadata is explicitly disabled.
Static mode: Do not render metadata container if no metadata is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions