![](/img/trans.png)
[英]How can I include a script defined in Theme to a view from Modules in Orchard
[英]How to include Glyphicons fonts into Orchard theme?
我正在使用Twitter Bootstrap 3.0.x處理Orchard主題
我將所有腳本和樣式添加到MyTheme / Scripts和MyTheme / Styles中。 它可以找到除Glyphicons圖像以外的其他圖像。
在CSS文件中,它通過使用相對路徑(../ fonts / glyphicon .....)來引用圖標。 因此,我創建了一個包含所有glyphicons文件的MyTheme / fonts。 但是,當我瀏覽時找不到這些文件(404)。
例如,當我瀏覽源代碼時:
http://localhost:9100/Themes/MyTheme/Scripts/bootstrap.js -> OK
http://localhost:9100/Themes/MyTheme/Styles/bootstrap.css -> OK
http://localhost:9100/Themes/MyTheme/fonts/glyphicons.. -> KO
有什么想法嗎?
我知道這很晚了,但也許會對其他人有所幫助。 您應該將fonts文件夾放在Content文件夾中,如下所示:
http://localhost:9100/Themes/MyTheme/Content/fonts/
之后,您應該在外部CSS文件中覆蓋bootstrap.css和bootstrap.min.css Glyphicons的@ font-face。 看起來像這樣:
@font-face{
font-family:'Glyphicons Halflings' !important;
src:url(../Content/fonts/glyphicons-halflings-regular.eot) !important;
src:url(../Content/fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),
url(../Content/fonts/glyphicons-halflings-regular.woff) format('woff'),
url(../Content/fonts/glyphicons-halflings-regular.ttf) format('truetype'),
url(../Content/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg') !important
}
Orchard似乎沒有在Content文件夾之外獲得諸如字體之類的內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.