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

Editor not working on block theme that has no index.html #39931

Open
MaggieCabrera opened this issue Mar 31, 2022 · 7 comments
Open

Editor not working on block theme that has no index.html #39931

MaggieCabrera opened this issue Mar 31, 2022 · 7 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@MaggieCabrera
Copy link
Contributor

MaggieCabrera commented Mar 31, 2022

Right now we are relying on the existence of an index.html template for a theme to be defined as a block theme, but I've encountered the following case now:

A block theme that has

  • a home.html template
  • archive.html
  • 404.html
  • search.html
  • page.html
  • single.html

According to https://developer.wordpress.org/themes/basics/template-hierarchy/ this covers all the possibilities and having an index.html file is redundant and the template is never used, but if we don't include it, then the theme doesn't work.

The workaround is having an index.html template that functions as an archive template and that feels kind of wrong to me.

/cc @WordPress/block-themers

@MaggieCabrera MaggieCabrera added the [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. label Mar 31, 2022
@justintadlock
Copy link
Contributor

I've ran into this issue, too. See: https://core.trac.wordpress.org/ticket/54910#comment:34

My suggestion was that we have the following flag in theme.json to let WP know that "Hey, this is a block theme."

"isBlockTheme": true

A style.css header would work too.

@scruffian
Copy link
Contributor

@youknowriad curious what you think about this one.

@youknowriad
Copy link
Contributor

Now that index.php is not mandatory anymore as well, maybe we could add something like || ! "index.php" in the check?

@scruffian
Copy link
Contributor

People might still want to include an index.php for security reasons...

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 4, 2023
@jordesign
Copy link
Contributor

Hey folks - is this still relevant, or have we managed to work around it otherwise?

@scruffian
Copy link
Contributor

I think it's still relevant.

@spencerfinnell
Copy link

After (trying) to wrap my head around handling of front-page.html, home.html, index.html, etc I came up with a system that didn't require index.html as a template and ran in to this issue.

It might make more sense (and give this more of a priority) if this is considered alongside other discussions about dealing with a static homepage and blog page vs. just "a file check".

i.e #56244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants