Skip to content

Add hookable method that determines a page's label wherever it is used in the admin #590

Description

@Toutouwai

By default, a page is represented in the PW admin by its title field. So admin label = page title.

That's fine a lot of the time, but it's also not uncommon to have scenarios where a page's label should be some combination of other page fields rather than some free text that a user types in. For example, you might want a page's label to be "{product_name} ({sku}) - ${price}".

At first it seems like the "List of fields to display in the admin Page List" setting will be helpful here.

Image

But then you realise that there are many places the page's label is going to be displayed that isn't covered by this setting: Page Edit headline, breadcrumbs, Lister, admin search results, and so on.

So I always end up locking the page title field and setting the title value by saveReady hook, but this creates work to update all titles if the label format changes in the future and could be avoided if PW provided a single hookable method with a corresponding template setting for defining a page's label wherever it is used in the PW admin. So that's what this request is for. 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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