Wp-calypso: (13P) Auto Load Homepage Templates

Created on 8 Aug 2019  Â·  21Comments  Â·  Source: Automattic/wp-calypso

All of the template-first themes that we are building include a default home page template. These templates make sure that the theme looks like the demo when activated.

Currently the theme's home page template is not set as the home page template when activating the theme. This means the user has to select the home page template manually in the template selector.

This should be done automatically. If a home page already exists that has not been edited then we should replace it. If it has, then we should create a new draft homepage with the new template.

WIP: D31358-code

Some more context for this: paAmJe-EG-p2/#comment-1747

[Goal] Full Site Editing [Type] Enhancement

All 21 comments

@apeatling D31358-code contains a first pass that's working rudimentary.

The problem we'll have again is hot-linking images. Once we side-loaded the images and replaced them, the page template won't be "unaltered" anymore and prevents a future switch.

How about we leave that page's content alone, create a new page for each theme (associated through post meta), and update the front-page assignment instead? That way we could update the images, users could update the content, and we could reuse them when a theme would be switched back to?

How about we leave that page's content alone, create a new page for each theme (associated through post meta), and update the front-page assignment instead? That way we could update the images, users could update the content, and we could reuse them when a theme would be switched back to?

The previous pages would need to be set as draft, otherwise they will continue to show up in navigation. I'm open to this as an option and trying it to see how it feels.

@apeatling Created D31499-code with this alternative approach. It's still missing image sideloading but imports/updates the homepage on theme-switch, limited to template-first themes.

This is really good, it feels amazing to activate a theme and it actually look like the demo when you visit your site.

Two things I noticed:

The "Home" title shows up when it doesn't on the demo site. Is this something we can control?

Screen Shot 2019-08-15 at 11 58 51 AM

For the draft home pages of previously activated themes, could we modify the page title to "Home ([themename] theme)"? It would at least give the user greater context as to why there are a bunch of draft home pages.

Screen Shot 2019-08-15 at 12 02 37 PM

If they reactivate a theme and the draft homepage is published again, update to back to "Home".

D31499-code is updated and now:

  • Sets the new homepage if switched to a template first theme, regardless of previously active
  • Sets theme mod to hide page title on homepage
  • Adds theme name context in pages list

image

@apeatling: I think this is approaching a state where it's ready for final review.
Final question I have, what if anything, should happen if the user switches away from a template-first theme?
And just to double-check: If home is the blog listing, we only add the page in draft and nothing else?

Good questions @obenland

What if anything, should happen if the user switches away from a template-first theme?

This has come up in live chats previously. Leaving the previous theme's homepage content in place is really confusing for users and totally unexpected. My thoughts would be when switching to an old theme:

  • If the theme has a blog page front, set the homepage as the posts page
  • Otherwise clear out the home page content. As a bonus, if there's a homepage page template in the old theme, assign that to the homepage?

The above I think are bonuses, and we could launch without the above and loop back on this. This is currently an issue right now with our business themes when a user switches to an older theme.

And just to double-check: If home is the blog listing, we only add the page in draft and nothing else?

For this iteration, yes. I think we could (as a future iteration on this), use the homepage template, and also automatically create a "blog" page that uses the blog listing template. Basically automatically shift their blog posts from the homepage and to a subpage if the theme has a static homepage.

/cc @iamtakashi on the above.

Otherwise clear out the home page content. As a bonus, if there's a homepage page template in the old theme, assign that to the homepage?

These are "un-edited" homepages?

I think it would be a new homepage that is blank, and the old one from a template-first theme would draft as above.

Interesting, I wouldn't have expected an empty homepage to be a better experience than the existing one in a new design

It doesn't look like WordPress allows us to set the blog page as the homepage (which kind of makes sense, that's what the show_on_front option is for.

We could set that one to posts, but that would disable the homepage updating until the user sets a new static homepage.

The confusion is coming from seeing the content of the theme you just moved away from, and thinking something has broken.

I updated D31499-code and its testing description.

  • Homepage template now gets switched if a static page is assigned to be the front page, and (new) if it's not, it gets still switched if we have an assigned page for posts.
  • When switching to an old theme, front page gets reverted to show posts list.

It makes sense to show posts list when they switch to an old theme.

With D31499-code, if they switch to one of the template-first themes, they always get the demo site homepage regardless of what they have on the homepage (edited, un-edited, or posts list). Is this expected?

I'm not sure how I managed, but I ended up having homepage that is marked as draft on my site.

Screen Shot 2019-08-19 at 23 33 15

Otherwise clear out the home page content. As a bonus, if there’s a homepage page template in the old theme, assign that to the homepage?

I think this is what that might mean …

Example 1

  1. See a site preview in signup.
  2. See that same content as your homepage in the editor after signup.
  3. Don’t make any edits.
  4. Visit theme showcase.
  5. Select Coutoire.
  6. See site with new homepage that looks just like Coutoire. Neat!
  7. Visit theme showcase and select Old Theme with a complicated homepage requiring customizer and Calypso interactions to set up.
  8. Visit site and see blank homepage. It doesn’t have the coutoire homepage but it doesn’t have the content you saw in step 1, 2, or 3 either.

I think Step 8 might be feel like you broke something?

It makes sense to show posts list when they switch to an old theme.

Let's do this for now, and hold off on any further homepage adjustments when switching to an older theme. We can iterate.

@obenland Two things on my mind:

  1. Giving Happiness Engineers a heads up on their P2 about this change, and what it means.
  2. Putting this behind an A/B test so we can measure the impact on rates of contacting support (I have a funnel). "Theme not looking like the demo" accounts for an outsized percentage of support contact -- does this change help with that? Also looking at launch rate impact.

@iamtakashi One other thing -- do the theme showcase instructions for the themes need to be updated to take into account these home page templates are activated automatically?

Is there any other theme documentation that needs updating?

Yeah, I think we need to update each documentation. But once we make one, we can copy and paste to all of them. The theme showcase page is the only documentation.

@obenland Redhill doesn't seem to work when I test this.

Deployed in r196263-wpcom

Was this page helpful?
0 / 5 - 0 ratings