Jump to content

Recommended Posts

This tutorial will teach you how to add a background image to the header in the default IPS theme, as shown below.

BEFORE:

post-1-0-20442000-1428452023_thumb.jpg

AFTER:

post-1-0-62767100-1428451892_thumb.jpg

1. To begin, log into your ACP and browse to Customization > Themes. Click the arrow to the right of your theme and select Manage Resources. Click the + Add Resource button at the top right.

2. Change the location from admin to global and use the Choose single file... button to upload your background image. This tutorial uses header.jpg as the file name, however you are welcome to use whatever name you like. Press Save.

post-1-0-58350000-1428452148.jpg

3. You will be taken back to the resources page. Use the Search: Name field at the top right to search for your file name (header.jpg). Under the Template tag column, you'll see your resource code which allows you to reference that image in your css and HTML. We'll need this code in the next step:

{resource="header.jpg" app="core" location="global"}

4. Go to Customization > Themes > Edit HTML and CSS. Click the CSS tab and choose custom.css. Paste the following code:

@media screen and (min-width:980px){

    #ipsLayout_header header{
      background-image: url('{resource="header.jpg" app="core" location="global"}');
      background-size: cover;
      background-position: 50% 0%;
      background-repeat: no-repeat;
    }
 
}

The first line, starting with @media restricts the css to desktops and laptops. The background image will not be shown for tablets or mobiles (which is ideal for loading times). If you wish to show the image on all devices, remove the top line, and the } in the very last line.

background-image simply defines our image URL, using the template tag from step 3.

background-size defines if the image should be stretched to occupy the entire space of the header. Remove this line if you don't want the image to use it's natural image size

background-position defines the position of the image (centered horiztontally, positioned at the top vertically).

background-repeat defines how the image should be repeated (no-repeat, repeat, repeat-x, repeat-y)

For an added effect, the background of the navigation bar has been changed to a semi-transparent black, which allows your background image to show beneath it. You are welcome to remove that code if you wish since it may not look correct for all images.

Done!

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

I don't know if it's ok to post here again, but I've followed the tutorial, but the background-image isn't going unde the menu bar and the search bar. The image ends exactly where the menu tabs starts. The image dimension is 1920x1080.

Am I doing something wrong there, or?

Link to comment
Share on other sites

5 hours ago, M10 said:

I don't know if it's ok to post here again, but I've followed the tutorial, but the background-image isn't going unde the menu bar and the search bar. The image ends exactly where the menu tabs starts. The image dimension is 1920x1080.

Am I doing something wrong there, or?

This tutorial was made for 4.1. If you’re using 4.2, the result will look different to the screenshot in the first post. 

Link to comment
Share on other sites

10 hours ago, M10 said:

Did you had the time to check again the forum? Sorry for this, but I really want to sort the thing out

This tutorial is for the Default IPS theme, as mentioned in the first line :) The Deflection theme uses different code, so you'll need to change #ipsLayout_header instead.

Link to comment
Share on other sites

2 hours ago, M10 said:

To be honest with you, I don't have any clue what to remove, or add, or change. I'm trying to figure it out, but nothing so far...

Can you give me the code? The one that is edited ? Please

    #ipsLayout_header{
      background-image: url('{resource="header.jpg" app="core" location="global"}');
      background-size: cover;
      background-position: 50% 0%;
      background-repeat: no-repeat;
    }

 

Link to comment
Share on other sites

  • 2 years later...
9 hours ago, mattprince said:

what size does the image have to be? I've tried it and mine is zoomed in so much uyou can't make out what it is

 

matt

The header dimensions vary depending on the size of your screen. If you create an image around 2000x200, that should be okay.

Link to comment
Share on other sites

Dimension has its own “Backgrounds” tab in its theme settings which allows you to edit the background images.

This tutorial is specifically made for the default theme in 4.4.x, you shouldn’t use this tutorial for Dimension. 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...