Orchard CMS theme images are not showing
I am using the correct helper call to get the image url in my theme:
@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/Content/Images/my-image.png")
... and I know the image is there and readable. But it doesn't show up when I try to navigate to it! Why is this happening?
+3
Josh schultz
source
to share
1 answer
From the docs ( http://docs.orchardproject.net/Documentation/Anatomy-of-a-theme ):
To allow file submissions, each folder containing static files such as stylesheets, images, or JavaScript code must contain a web.config file containing the following content:
<?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>
+6
Josh schultz
source
to share