Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi!
It's is possible to change template of rendered page by condition in hijacked controller?
For example, I have doctype "Profile" with two templates - "ProfileTpl" and "PofileExtendedTpl"
I need to change template in Index action, like this:
public override ActionResult Index(RenderModel model, bool? ext) { if (ext.HasValue && ext == true) return NotCurrentTemplate("PofileExtendedTpl", model); return base.Index(model); }
Thanks!
Ok. I Just found that, I can simple use return View("PofileExtendedTpl")
Another solution to change template is to add 'altTemplate' get parater.
Read more: https://www.safaribooksonline.com/library/view/umbraco-users-guide/9780470560822/chap4-sec14.html
https://our.umbraco.org/forum/templating/templates-and-document-types/8588-alttemplate-url-rewriting
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Change Template from controller
Hi!
It's is possible to change template of rendered page by condition in hijacked controller?
For example, I have doctype "Profile" with two templates - "ProfileTpl" and "PofileExtendedTpl"
I need to change template in Index action, like this:
Thanks!
Ok. I Just found that, I can simple use return View("PofileExtendedTpl")
Another solution to change template is to add 'altTemplate' get parater.
Read more: https://www.safaribooksonline.com/library/view/umbraco-users-guide/9780470560822/chap4-sec14.html
https://our.umbraco.org/forum/templating/templates-and-document-types/8588-alttemplate-url-rewriting
Thanks
is working on a reply...