Commit b6fa408
fix(templates): stop leaking the template's title into published pages (CoreBunch#217)
composeTemplateChain always returned the innermost TEMPLATE's title as
the merged page's title, never the actual page or entry being
rendered. Every published page's <title> and <head> metadata came from
whichever template wrapped it: ordinary pages all showed the
"everywhere" template's title, and post-type entries showed the
postType template's title instead of the entry's own title.
For a page terminal, terminal.page is already available inside
composeTemplateChain, so use its title directly. For an entry
terminal there is no Page object at that layer, so the two callers
(renderPublishedDataRowTemplate and the row preview handler) set
merged.title from the published/draft row's own title cell right
after composing, before the page is rendered.
Co-authored-by: Henrique Chiuchi <henriquechiuchi@outlook.com>1 parent 76f15fa commit b6fa408
3 files changed
Lines changed: 11 additions & 1 deletion
File tree
- server
- handlers/cms/data
- publish
- src/core/templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
0 commit comments