Skip to content

Remove coupling of templates, parts, and patterns when switching themes #25071

@jameskoster

Description

@jameskoster

I believe the way templates/template parts are handled upon theme-switch may warrant some exploration. For the purpose of this conversation let's assume you are using block themes exclusively.

Currently when you activate a new theme, any of the old theme templates that you have customised are retained. In general I think this behaviour is good as it reduces the unexpected disruption to layout that can occur upon theme activation. But "in general" ≠ "always" :)

Imagine you made some very minor template edits to your post content template part in the past. Now imagine you found a new theme with a post layout you really like. With the current implementation, when you activate the new theme, your posts will continue to render using the old themes post layout, undermining the whole purpose for switching themes in the first place. To get the desired experience you'd have to manually go and delete/revert your old template customisations - an activity that is totally detached from theme activation.

Let's talk about whether users should be presented with options for what should be done with their customisations when they activate a new theme. At the very least, it seems prudent to ask them whether they want to keep their customised templates. But is there a case to be made for unedited templates being kept as well? Maybe their motivation for switching themes is based more on style than layout.

There is potential for any decisions made here to be extended to Global Style customisations as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DesignNeeds design efforts.[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] TaskIssues or PRs that have been broken down into an individual action to take

    Type

    No type

    Projects

    Status

    🎨 Needs design

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions