Umbraco 9 - Set alternate template programmaticall...
# help-with-umbraco
r
How to set alternate template programatically? I have a article page content and assigned two templates. Article content has to be rendered in an another page with different frontend. So I created another template. But how to check if the url should take the default template or alternate template. The application was in Umbraco 7 and has beed upgraded to 9. In Umbraco 7, the template alias is passed as last segment of the path. ContentFinder is added to handle the routing using ContentFinderResolver.Current.InsertTypeBefore();
m
you can also extend your
articlePage
with a renderController. if you want a friendly url... https://docs.umbraco.com/umbraco-cms/reference/routing/custom-controllers#how-can-a-page-be-requested-via-two-different-templates
r
@Mike Chambers Thanks for sharing the links. I will implement usage altTemplate