Different stylesheets for Umbraco multisite

给你一囗甜甜゛ 提交于 2019-12-12 04:17:50

问题


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.

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.


回答1:


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

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.

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.



来源:https://stackoverflow.com/questions/44073450/different-stylesheets-for-umbraco-multisite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!