Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Drupal's web based interface lets you change a few basic bits of your site's appearance through the theme administration page. But sometimes, you want to keep a theme's basic layout and typography, but just change a few of the graphics it came with. I found that's often the case when I download third-party themes. Note that you'll need right level access to your server folder where the Drupal installation is location. If you don't have that already, talk with your system administrator before going forward. The first thing that we're going to do is we're going to switch to another theme. We'll go up to Administer and Themes and the one we'll select is called Pushbutton.
We're going to use this one because I happened to know that it contains a lot of additional graphics including some that we can change. Go to Save configuration and there we are, this is the Pushbutton theme. You see at the beginning of every block, we have this little arrow up here and I want to replace that with something a little bit more colorful. So, that's what we're going to do. To do so, we have to go to the Drupal installation directory. I go over here, click on Finder and go down to hide others, so I can see my desktop. I already have my Drupal folder open here. For me, that's in the Sites directory, but for you, it will be wherever you first install Drupal. I also have opened the folder that contains the Exercise Files. This is the graphic that we're going to use in place of the one I just pointed out.
Let's go back to our Drupal installation directory and find all of the files that make up that theme. You'll find them in themes, Pushbutton. Then to make this a little bit easier to figure out, we'll sort by type of file, right up here. Make the window a little larger, so we can see everything. Since it's sorted by type of file, all of the cascading Style Sheets for example are in one place, all of the graphics are in one place and all of the PHP files that describe pages within this theme are in one place.
Looking around, I just graphically see, ah! That looks like the one that I want. Let's see if there's any other that looks like that. No, that appears to be the one I want. We could just do this by trial and error, by dragging this into its place. But I'm going to show you another way to figure out, if that's actually the graphic that you want. To do so, we go back to our Drupal administration. On the Mac, I'm doing that by hitting Command+Tab and going back to the web browser. We're going to look at this page in its source, we know that this graphic is right next to the word Admin which is right above the phrase My Account. We go up to View and View Source, wherever it is on your browser and then I'll just quickly do a find by hitting Command+F or Ctrl+F and search for that phrase, My Accounts.
Aha! Now we see here that admin is between some H3 tags, I'm going to guess that that's actually the tag that controls whether or not that little graphic appears. If you're good with CSS, you may want to dig further as it happens, I've researched this one already and I know that that's the place. We'll close that out and then go back to our Finder. Hide everything else and take a look at the CSS files that make up this theme. Scroll down until we find it, there they are at the bottom. In every theme, you'll have one main CSS file called style.css. In this particular theme, you also have style-rtl. That means right to left, for when people are using an alphabet that goes from right to left such as Hebrew. We'll open this up in a Text Editor and now I'm going to search for that H3 tag and see if that's where the graphic actually is.
I hit Command or Ctrl+F, type in H3 and find the next one. Well, we don't see any graphic showing here, so let's find the one after that. We don't see any graphics there, so we keep going. Aha ! Here we have a graphic showing up, icon-block.png. Is that the same one we identified before? Scrolling up to see it, yes it is. We throw that away either by dragging it to the trash or on the PC, right clicking and choosing Delete.
We then go down to the graphic we have and give it the name that we need, in this case icon-block.png. Very good, now let's go back to our site and see if that change actually took place. All we need to do is reload the page and Walla! We've changed the little graphic. The same is true for the other graphics on the site. It may take a little bit of detective work to figure out what the graphics are, but once you can do that, you can change pretty much anything you see in any theme on Drupal.
Before we finish, I'm going to go back and change our theme back to Bluemarine. We save the configuration and we're back where we started. The last step in the process is to play with the results until you like what you see. Ultimately, you might decide that you need a completely different base theme or a different configuration of the theme you have. But now you have all the tools that you need to change your theme and its graphics.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.