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

Custom Templates #2192

Closed
Tracked by #2045
cynthianorman opened this issue Jan 31, 2024 · 13 comments
Closed
Tracked by #2045

Custom Templates #2192

cynthianorman opened this issue Jan 31, 2024 · 13 comments
Assignees
Labels
[Content] Published Marks closed issues as content that was actually published.

Comments

@cynthianorman
Copy link
Contributor

cynthianorman commented Jan 31, 2024

Details

  • Content type: Lesson
  • Content title: Custom Templates
  • Topic description: Using the theme.json file, we will register a custom template we create from scratch.
  • Audience: Developer
  • Experience Level: Intermediate

Learning Objectives

  • Build a custom template from scratch and export it to your local theme folder.
  • Register a custom template using the theme.json file.
  • Familiarize yourself with the workflow of updating templates using the Create Block Theme plugin.

Related Resources and Other Notes

Automation Code

@cynthianorman cynthianorman self-assigned this Jan 31, 2024
@github-project-automation github-project-automation bot moved this to 👋 Ready to Create in LearnWP Content - Development Feb 12, 2024
@kaitohm kaitohm moved this from 👋 Ready to Create to 🚧 Drafts in Progress in LearnWP Content - Development Feb 12, 2024
Copy link
Contributor

github-actions bot commented Feb 20, 2024

Lesson Development Checklist

  • Gather any relevant links to Support, Docs, or related material
  • Description and Objectives finalized
  • Lesson created and announced to the team for review
  • Lesson reviewed
  • Lesson video submitted and published to WPTV
  • Lesson created on Learn.WordPress.org
  • Lesson video published to YouTube
  • Lesson on Learn.WordPress.org updated with YouTube video
  • Lesson published to Learn.WordPress.org

@cynthianorman
Copy link
Contributor Author

@jonathanbossenger how do you feel about this lesson's topic being shown primarily using the Create Block Theme plugin? I could include a brief mention of the Export zip file followed by copy/paste manual task. Recall we will already have the plugin topic covered in the Beginner Developer module.

@jonathanbossenger
Copy link
Collaborator

@cynthianorman I assume you mean using the Create Block Theme functionality to export the template created in the editor to a physical template file?

In that case, yes, I agree, going with a Create Block Theme functionality first, but mentioning other options as well makes sense.

To the best of my knowledge, the goal of Create Block Theme is to eventually become redundant, ie all it's functionality is eventually baked into the core. However, just like create-block is now the recommended tool to scaffold a new block, I do agree we should recommend folks use Create Block Theme when developing themes.

So if something is complicated or requires a manual process that Create Block Theme solves, I agree that we should recommend using Create Block Theme first, but also mention the alternatives.

@cynthianorman
Copy link
Contributor Author

cynthianorman commented Feb 21, 2024

@jonathanbossenger this is the workflow I thought could work for this lesson. It actually uses the Save Changes option rather than Export.

Just a quick note on this in regards to the needed updates for the course A Developers Guide to Block Themes – Part 1. We had questions when it came to updating module 4 and custom templates. I wasn't sure which workflow would work best but I'm now thinking the one I've created here for this lesson would work for us.

  1. With TT4 in Site Editor add a new template
  2. Use Single Item: Post, select All Posts, and choose the pattern presented for posts
  3. In the Site Editor, remove the featured image and Save changes (this saves your changes to the database)
  4. Using the Create Block Theme plugin, Save Changes (this downloads the file to your themes folder)
  5. Within your code editor, change the filename to single-no-image.html
  6. In theme.json, add your new custom template and name it Single Post no Featured Image so it will have a user-friendly name in the Site Editor
  7. Back in the Site Editor, make a new change and point out that it is saved to database
  8. Show how this looks in Manage all templates with the template customized by user
  9. Using the Create Block Theme plugin choose the Save Changes option (this removes changes from database and saves them to your theme file)
  10. Show how this looks different in Manage all templates (with all templates coming from theme not user)
  11. Finally, back in the code editor, show how your change is saved to your theme file

@jonathanbossenger
Copy link
Collaborator

That sounds great @cynthianorman excellent work.

@cynthianorman
Copy link
Contributor Author

This Intermediate Theme Developer Learning Pathway Lesson is ready to be reviewed. Please follow the steps listed under Guidelines for reviewing content. Thank you for your contribution! ✨

https://youtu.be/WAkmnyi_NtU (unlisted)

@cynthianorman cynthianorman moved this from 🚧 Drafts in Progress to 🔎 Ready for Review in LearnWP Content - Development Mar 21, 2024
@devmuhib009
Copy link
Member

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

  • Learning outcomes/objectives are clear.
  • Technical concepts introduced in the content are accurate.
  • The speed of demonstrations are easy to follow.
  • The narration audio matches what is shown visually.
  • Spelling and grammar are correct.
  • Sound quality is consistent throughout the video.
  • Brand Usage Guidelines and Promotional Guidelines are being followed.
  • Media assets are all in the public domain (CC0).

@cynthianorman
Copy link
Contributor Author

@devmuhib009 Thank you so much for taking the time to review Muhibul!

@cynthianorman cynthianorman moved this from 🔎 Ready for Review to ✅ Preparing to Publish in LearnWP Content - Development May 13, 2024
@jonathanbossenger
Copy link
Collaborator

jonathanbossenger commented May 24, 2024

@jonathanbossenger
Copy link
Collaborator

@cynthianorman cynthianorman moved this from ✅ Preparing to Publish to 📜 Published or Closed in LearnWP Content - Development Jun 7, 2024
@cynthianorman
Copy link
Contributor Author

@jonathanbossenger

YouTube Chapters

(0:06) Learning objectives
(0:28) Creating a custom template
(1:09) Registering custom templates in theme.json
(2:15) Using Create Block Theme plugin to update theme files
(4:14) Next steps

@jonathanbossenger
Copy link
Collaborator

@jonathanbossenger
Copy link
Collaborator

//publish

@github-actions github-actions bot added the [Content] Published Marks closed issues as content that was actually published. label Jun 7, 2024
@github-actions github-actions bot closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Content] Published Marks closed issues as content that was actually published.
Projects
Status: 📜 Published or Closed
Development

No branches or pull requests

3 participants