简体   繁体   English

Umbraco动态更改页面模板

[英]Umbraco change page template dynamically

I am using Umbraco 7.5.8. 我正在使用Umbraco 7.5.8。 I would like for a page to switch to another template if the browser being used is certain versions of internet explorer. 如果使用的浏览器是Internet Explorer的某些版本,我希望页面切换到另一个模板。 I wasn't sure how to do this or if it could be done. 我不确定如何执行或是否可以执行。

It seems that adding the altTemplate parameter to the URL, eg: 似乎将altTemplate参数添加到URL,例如:

my-domain.com/my-page?altTemplate=newTemplateName  

works right out of the box (just make sure to add the new template to the document type's "Allowed Templates" in Umbraco). 可以直接使用(只要确保将新模板添加到Umbraco中文档类型的“允许的模板”即可)。 Combined with Mario's suggestion to use JavaScript, this should do it. 结合Mario关于使用JavaScript的建议,应该做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM