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

Classic themes: tutorial on moving away from widgets to template parts #259

Open
bph opened this issue May 2, 2024 Discussed in #254 · 9 comments
Open

Classic themes: tutorial on moving away from widgets to template parts #259

bph opened this issue May 2, 2024 Discussed in #254 · 9 comments
Assignees

Comments

@bph
Copy link
Collaborator

bph commented May 2, 2024

Discussed in #254

Originally posted by annezazu April 25, 2024
Pulling out of this GitHub issue and thinking about the future of patterns & template parts, including exposing patterns for classic themes in 6.6, I think we need a blog post talking about how classic theme authors should move to include template parts instead of adding entity based blocks to widget sidebars.

I'd see this as a part tutorial and part announcement/encouragement. I think a lot of material could be reused and it could include information about the future of exposing patterns and why that's a more viable pathway with classic themes, including for template parts.

@bph bph added flow: needs writer the idea/pitch needs a writer flow: approved can move forward Advanced Themes labels May 2, 2024
@bacoords
Copy link

bacoords commented May 8, 2024

👋 I'd be interested

@justintadlock
Copy link

@bacoords - Glad to have you here and volunteering for this post. I'm also excited to see what you come up with. Feel free to ask me for any help or anyone from the #core-dev-blog Slack channel about getting started.

Here's a list with important links for contributing:

The biggest thing is to put your draft (when you start it) in a Google Doc that has open comments/suggestions and leave the link to it here. The review process will happen within the doc.

@bph bph removed the flow: needs writer the idea/pitch needs a writer label May 15, 2024
@bacoords
Copy link

Here's a link to the Google doc for this article. As of right now there's just a rough outline to show what I plan to cover and the examples I'm hoping to include. I'll be working on fleshing this out a bit more throughout the week and turning it into an initial draft.

https://docs.google.com/document/d/1h4ED2l__6Hq9hMEIuDJn1oeo8IvMsTuBjgFNGzLknn8/edit?usp=sharing

@bph
Copy link
Collaborator Author

bph commented Jun 4, 2024

Hi there @bacoords - I was wondering what your timeline is to work on your article.

@bacoords
Copy link

bacoords commented Jun 4, 2024

Hey @bph - actually do you mind just opening the initial outline and making sure it tracks with your team's concept for this article?

@MadtownLems
Copy link

We've long wanted to move from Widgets to Template Parts, but one of our biggest hangups is that our theme's primary widget area (footer) has a black background, where page/post content has a white background. I would hope that a tutorial that talks about switching can help us figure out how to best handle that in a way where editing the Template Part is done in a way that reflects how things will look on the front end.

@bph
Copy link
Collaborator Author

bph commented Jun 5, 2024

@bacoords The outline is great....

There is a previous article on the developer blog: Upgrading the site-editing experience with custom template part areas. I just mention it here so it can be added to a resource list... don't remember if that also applies to classic themes

@bacoords
Copy link

bacoords commented Jun 5, 2024

I would hope that a tutorial that talks about switching can help us figure out how to best handle that in a way where editing the Template Part is done in a way that reflects how things will look on the front end.

While I can think of some approaches for applying styles to the block editor based on a specific instance, I don't know if that'll fit into the scope of this particular article. It would probably need to be it's on article. Mainly because there's not a simple way to do it, you would have to enqueue stylesheets to the block editor, etc.

If I see some simple approach that I'm missing while I research/write this, then I'll definitely include it.

@justintadlock
Copy link

I use a custom block style variation for those sort of large sections. For example, here's a "Site Footer" style variation in my theme:

image

It's not an ideal method IMO since it's a one-off thing, but it's at least one approach. I feel like this could be outside the scope of the primary topic. Maybe a minor note, at best. But I'll leave that up to Brian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants