#39368 closed defect (bug) (fixed)
.page-template-default body class in editor doesn't appear in initial post/page load.
Reported by: | timph | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.7.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description
The class .page-template-default isn't in tinymce editor body classes on initial load if default template is used. It was causing some odd behaviors when I was testing some themes out. This was because the themes were adding specific styles for .page-template-default. This class seems to only get added when you select a template from Page Attributes > Default, and there were some major visual differences from initial page load to what would be seen when selecting that template from page attributes. I think for consistency it should be present if that's the template in use.
- Add a page template to the theme. Mine was page-home.php
- Add a new page. This should use the default template.
- Inspect the body classes of the editor, there's no class added to designate this is the page-template-default at this point.
- Under Page Attributes, select Home. Inspect the body classes, you'll see page-template-page-home is applied.
- Select the Default template, you'll see page-template-default is applied and page-template-page-home is removed.
- Select the home page template again.
- Publish the page. Inspect the body class you'll see it's still there. Refresh the page. It's still there.
- Select the default template, then update the page and refresh. You'll see that the class is no longer present.
Attachments (1)
Change History (7)
#1
@
8 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#2
@
8 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 4.7.1
39368.patch should fix this. Moving to 4.7 for consideration.
I'm not sure what the best behavior is here. Adding page-template-default
when the template is determined by the template hierarchy (i.e. we don't know the exact template that is used) doesn't seem that good. Not adding anything seems better?
However in the editor we should match what happens on the front-end.
Confirmed, tested with Twenty Twelve. The additional classes were introduced in #37599.