2013-01-31 65 views
3

我使用的是正確的助手調用來獲取URL在我的主題圖像:果園CMS主題圖像顯示不出來

@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/Content/Images/my-image.png") 

...我知道圖像是存在的,是可讀的。然而,當我嘗試瀏覽它時,它並沒有顯示出來!這是爲什麼發生?

回答

6

從文檔(http://docs.orchardproject.net/Documentation/Anatomy-of-a-theme):

爲了使文件送達,每個包含靜態文件,如樣式表,圖片或JavaScript代碼應該包含一個web.config文件的文件夾其中包含以下內容

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.web> 
    <httpHandlers> 
     <!-- iis6 - for any request in this location, 
      return via managed static file handler --> 
     <add path="*" verb="*" type="System.Web.StaticFileHandler" /> 
    </httpHandlers> 
    </system.web> 
    <system.webServer> 
    <handlers accessPolicy="Script,Read"> 
     <!-- iis7 - for any request to a file exists on disk, 
      return it via native http module. 
      accessPolicy 'Script' is to allow for a managed 404 page. --> 
     <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" 
      preCondition="integratedMode" resourceType="File" 
      requireAccess="Read" /> 
    </handlers> 
    </system.webServer> 
</configuration>