U4-274 - Adds config option to disable alternative templates
This commit is contained in:
@@ -586,8 +586,9 @@ namespace Umbraco.Web.Routing
|
||||
// only if the published content is the initial once, else the alternate template
|
||||
// does not apply
|
||||
// + optionnally, apply the alternate template on internal redirects
|
||||
var useAltTemplate = _pcr.IsInitialPublishedContent
|
||||
|| (UmbracoConfig.For.UmbracoSettings().WebRouting.InternalRedirectPreservesTemplate && _pcr.IsInternalRedirectPublishedContent);
|
||||
var useAltTemplate = UmbracoConfig.For.UmbracoSettings().WebRouting.DisableAlternativeTemplates == false
|
||||
&& (_pcr.IsInitialPublishedContent
|
||||
|| (UmbracoConfig.For.UmbracoSettings().WebRouting.InternalRedirectPreservesTemplate && _pcr.IsInternalRedirectPublishedContent));
|
||||
string altTemplate = useAltTemplate
|
||||
? _routingContext.UmbracoContext.HttpContext.Request[Constants.Conventions.Url.AltTemplate]
|
||||
: null;
|
||||
|
||||
Reference in New Issue
Block a user