This project is read-only.

Customize folder Image

Topics: Customizing Orchard
May 30, 2013 at 7:42 AM
Edited May 30, 2013 at 7:54 AM

I have an image title.png, I integrate this images in a folder Images.
I copy past this folder in Orchard.Web and in the Theme and add the web.config in the two folders.
The request to access to the image is images/title.png : <a href="/"><img src="/Images/title.png" alt="" /></a>
Orchard gets the image from the folder Orchard.Web, I would like to get the image from folder in theme.

Is anyone can share a tips :)
May 30, 2013 at 10:48 AM
You need to use a path that points to the image in your theme. For example, if your theme is called MyTheme and it has a folder called Images with an image called title.png, you would point to it like this:

May 30, 2013 at 8:01 PM
May 31, 2013 at 7:44 AM
Edited May 31, 2013 at 7:44 AM
Hum ok I change the image
and I have path in the css file, I include this file in the layout by Style.Include("site.css");
So how is-it posible to really push the image defined in the css to target the current theme
as <img src="@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/Content/Header.jpg"))" />.

    width: 728px;
    height: 100px;
    display: block;
    float: left;
    background-image: url(images/top_bg_raye.png);
    background-repeat: repeat;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 0.6em;
    text-align: center;
    line-height: 11px;
    color: #B8B8B2;
May 31, 2013 at 12:44 PM
Edited Jun 1, 2013 at 10:49 AM
From your CSS file, you need to provide the path to the image relative to your CSS file.

If this is your folder structure:


Then in site.css, you use this:
background-image: url(../Images/MyImage.png);
May 31, 2013 at 8:41 PM
Nice Thank you for the tips.