This project is read-only.

Images are in folder, but browser refuses to load for Orchard - routing problem?

Topics: Customizing Orchard
Jul 8, 2013 at 11:03 PM
I am trying to customize all the page header on Orchard v1.6.1 by replacing the text (of the store name) with a clickable image link. However, the image does not show up.
    var homeUrl = Href("~/");   
<h1 id="branding"><a href="@homeUrl">
    <img src="@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/Images/Logo.gif"))" height="65" width="550" alt="@WorkContext.CurrentSite.SiteName" />
When i load the page, the logo image does not display, so I figured I had the path wrong.
Debugging further, I found the path to be 100% correct, yet the image does not display and I get a 404 error.
Server Error in '/OrchardLocal' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /OrchardLocal/Themes/TheThemeMachineResponsive/Images/Logo.png

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045 
I browsed to the folder
http://localhost:30320/OrchardLocal/Themes/TheThemeMachineResponsive/Images/ and I got a directory listing showing the Logo.png file.

I checked security for the file and made sure it was set to allow 'everyone' permissions.

To eliminate the browser (Firefox), I opened the image fine on the harddrive and it displayed in the browser.

The only thing I can think of is that there is a routing problem somewhere.

Jul 8, 2013 at 11:19 PM
You forgot to put a web.config in there. Copy one from another images folder.
Jul 8, 2013 at 11:50 PM
Edited Jul 8, 2013 at 11:50 PM
the contents look like this...
<?xml version="1.0" encoding="UTF-8"?>
      <!-- iis6 - for any request in this location, return via managed static file handler -->
      <add path="*" verb="*" type="System.Web.StaticFileHandler" />
    <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" />
Jul 9, 2013 at 12:20 AM
That's right. Maybe I should get some sleep :)