Adding different CSS files to different pages in Orchard CMS?

一个人想着一个人 提交于 2019-12-05 20:37:25

You should use URL Alternates feature for that. It's described here, in the section "URL and Widget Alternates".

After enabling the feature, copy the Layout.cshtml you found in your theme and rename it to Layout-url-homepage.cshtml. This one will only be used for rendering the homepage, so just add your Style.Include calls there and you're set.

You can try 2 things.

  1. Use the Classy feature in Vandaley Industries module (http://gallery.orchardproject.net/List/Modules/Orchard.Module.Vandelay.Industries). Then you can add a script to any content type.

  2. Create an alternate at the corresponding URL.

They are many other ways, as Orchard is SOOOO extensible. Try these two first. :)

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