mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 13:22:39 +03:00
🐛 Fixed page vs post preview template picking
refs 0c097f6532
- When viewed in "preview" context pages resolved to a "post" template instead. The bug was introduced with the referenced commit during post resource's `page` property migration
This commit is contained in:
parent
4fa412c880
commit
5569844019
@ -190,7 +190,7 @@ module.exports.setTemplate = function setTemplate(req, res, data) {
|
||||
} else if (res.routerOptions.type === 'custom') {
|
||||
res._template = _private.pickTemplate(res.routerOptions.templates, res.routerOptions.defaultTemplate);
|
||||
} else if (res.routerOptions.type === 'entry') {
|
||||
if (res.routerOptions?.context?.includes('page')) {
|
||||
if (res.routerOptions?.context?.includes('page') || (res.routerOptions?.context?.includes('preview') && data.page)) {
|
||||
res._template = _private.getTemplateForEntry(data.page, 'page');
|
||||
} else {
|
||||
res._template = _private.getTemplateForEntry(data.post, 'post');
|
||||
|
Loading…
Reference in New Issue
Block a user