Umbraco多站点的不同样式表 [英] Different stylesheets for Umbraco multisite

查看:75
本文介绍了Umbraco多站点的不同样式表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个Umbraco实例上建立了两个不同的网站,但我希望它们使用略有不同的样式表.我发现了这篇博客文章: http://www.spacebetween.co.uk/blog/2016-10-27-journal-a-junior-multisite 试图证明如何实现这一目标.

I have set up two different websites on one Umbraco instance, but I want them to use slightly different stylesheets. I found this blog post: http://www.spacebetween.co.uk/blog/2016-10-27-journal-of-a-junior-multisite which attempts to demonstrate how this can be achieved.

但是,给出了两位代码,但没有关于放置它们的任何方向的指示.我尝试了几个不同的地方,但是都没有成功.我希望比我更了解Umbraco和MVC的人会仔细研究一下并解释它应该如何工作,因为我有点茫然.

However, there are two bits of code given without any direction as to where to place them. I've tried a couple of different places but with no success. I'm hoping someone who knows more about Umbraco and MVC than I do will look this over and explain how it should work because I'm at a bit of a loss.

推荐答案

您可以根据自己的需要,以多种不同的方式实现这一目标

You can achieve this in a lot of different ways, depending on your needs

最简单的方法是在根节点级别定义一个新的dropdownlist属性,内容编辑器可以在其中选择样式表(或主题),然后让母版页检索此属性并将路径与样式表目录匹配.

Easiest way would be defining a new dropdownlist property on root node level where the content editor can select the stylesheet (or theme) and let the master page retrieve this property and match the path to the stylesheet directory.

如果您不仅需要更改样式表,还可以考虑为网站定义不同的模板.您可以为您的文档类型选择多个模板.

If you need more than just stylesheet changes, you can consider defining different templates for the sites. You can select multiple templates for your documenttypes.

最先进的方法是创建一个新的ViewEngine,以更改不同网站的整个主题(母版页,视图和部分内容).但这会有所帮助.

The most advanced way would be creating a new ViewEngine that changes the entire theme of the different websites (master pages, views and partials). But this would some work.

这篇关于Umbraco多站点的不同样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆