Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add starter content #116

Closed
kjellr opened this issue Oct 15, 2021 · 7 comments · Fixed by #243
Closed

Add starter content #116

kjellr opened this issue Oct 15, 2021 · 7 comments · Fixed by #243
Labels
[Type] Enhancement New feature or request [Type] Task
Milestone

Comments

@kjellr
Copy link
Collaborator

kjellr commented Oct 15, 2021

On a fresh install, the theme should generally end up matching the demo site by default:

Screen Shot 2021-10-15 at 10 01 26

  • Add a static homepage, with the home slug (so that it inherits our page-home.html template. The content of this page should match the demo above.
  • Maybe a few posts to match the ones on the demo site.

In previous themes, we created starter content to help set folks up with this. Is this the best way to handle this for block themes?

@kjellr
Copy link
Collaborator Author

kjellr commented Oct 15, 2021

I opened a Gutenberg issue to explore this there as well: WordPress/gutenberg#35680

@carolinan
Copy link
Collaborator

It was actually not so easy to get starter content to work even with the current "live preview" button before the theme is activated.

-I ended up using page-slug.html templates instead of the "home/frontpage/blog/" because there is no conditional like in PHP where we can show single page content if it's set to show a page, and query when it is set to show posts.

Using a query and setting it to inherit is one way but it did not work for me since I wanted to show the full content for the page, and only show excerpt for the post list...

@mburridge
Copy link
Contributor

Is it normal to have starter content? I don't recall ever installing a theme that added content to a site. Do you intend that the starter content will be "hard coded" into the .html files to be over-ridden by templates created in the editor? Personally I don't think I'd want that 'extra job', I want a theme to be blank so that I can just start adding content.

@carolinan
Copy link
Collaborator

Starter content is:

  • Visible in the preview in the theme directory of WordPress.org, without it, you can only show the blog, not a custom homepage.
  • Only available for users on fresh, empty WordPress installations.
  • Optional, you can preview it and then choose to publish it.

@mburridge
Copy link
Contributor

Thanks for that @carolinan. I've never used starter content before when I've built sites, but I've been digging in and learning more.

It seems to require the customiser. How is this going to work for an FSE theme?

And from a development point of view, would starter content still be hooked to add_theme_support( 'starter-content', ....), or does it need to be implemented differently in an FSE theme?

@carolinan
Copy link
Collaborator

It seems to require the customiser. How is this going to work for an FSE theme?

It does, but it is only the menu item that is removed. The starter content can still be previewed and activated via the themes screen, using the Live Preview button.

..That's what we need to figure out in WordPress/gutenberg#35680

@mburridge
Copy link
Contributor

Thanks @carolinan, so we're waiting on resolution of that issue before this one can be addressed? There's nothing to do here at the moment?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
[Type] Enhancement New feature or request [Type] Task
Projects
None yet
3 participants