Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme.json: support a description value for templateParts #34723

Open
chthonic-ds opened this issue Sep 10, 2021 · 0 comments
Open

theme.json: support a description value for templateParts #34723

chthonic-ds opened this issue Sep 10, 2021 · 0 comments

Comments

@chthonic-ds
Copy link
Contributor

@chthonic-ds chthonic-ds commented Sep 10, 2021

What problem does this address?

In theme.json templateParts supports two values: name and area.

name matches with the filename for a template part. When viewing Site Editor > Template Parts, available parts are described using the value for name. This can result in an "unfriendly" label for each part, especially if using overly descriptive names.

For example, the following in theme.json:

"templateParts": [
     {
         "name": "header-site-logo",
         "area": "header"
     },
     {
         "name": "header-site-logo-navigation",
         "area": "header"
     },
     {
         "name": "header-site-logo-site-title-navigation",
         "area": "header"
     }
 ]

...currently displays like this in the Site Editor:

template-part-label-current

What is your proposed solution?

Is it possible to support a third value in templateParts, please? Perhaps description could work as the key.

This would allow for the following:

"templateParts": [
     {
         "name": "header-site-logo",
         "area": "header",
         "description": "Logo only"
     },
     {
         "name": "header-site-logo-navigation",
         "area": "header",
         "description": "Logo & navigation"
     },
     {
         "name": "header-site-logo-site-title-navigation",
         "area": "header",
         "description": "Logo, site title & navigation"
     }
 ]

template-part-label-proposed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant