How do I access my HTML for my theme? I need to make some little changes.

Comments

gollyg’s picture

It kind of depends. Your theme html will reside in either

  • /themes
  • /sites/default/themes
  • /sites/all/themes

If you are using a core theme it will be in the first location. You should copy the theme into your sites/default/theme directory before making any changes, as this directory will not be overwritten when you upgrade. Note: you may have to create this directory if you haven't already

You will find various tpl.php files within the theme folder, and these will contain the main html. But chances are some of the changes will be buried away in a module theme file. This can be a little tricky to find, especially in 5. However once you find the main theme function controlling the output it is fairly simple to override.

I would suggest looking at your theme functions, and then reading the handbook http://drupal.org/theme-guide

Any hints as to what kind of things you need to change?

IZasPIE’s picture

When I put blocks in, there is a grey line that goes at the top of the block where words are supposed to be. But I put a google ad at the bottom where that grey line shouldn't be. That's what I am trying to remove! Or is there a different way of inserting google ads?

gollyg’s picture

There is a google adds module that can take care of it.

But the problem you are probably having is that the script tags are being stripped out. try changing the input format for the block to allow everything (i dont think full html allows script tags, so you may have to add the script tag to the input format (actually, create a custom format because you dont want anyone else getting the ability to add script tags!)

To control the theme of a block you modify the block.tpl.php file. If you want to target a specific block you can use the block id, eg block-block-1.tpl.php. (from memory - actual names may vary)

IZasPIE’s picture

This is what I am talking about if you want to take a look: www.justlaff.com

The gray thing at the top of the bottom google ad.

IZasPIE’s picture

Anybody?

nevets’s picture

That is the title area for the theme, it is a div with class 'blockhead'. For your blocks where you want no title you should be using <node>. It you are doing that, then the themes block.tpl.php is always outputting the 'blockhead' instead of check to see if there is an actual title.

IZasPIE’s picture

That's fine.
But can anyone tell me hot to get to the HTML file?

dman’s picture

As nevets said, the grey block is being called by the class 'blockhead'.
So just run a find-in-files for that string. That'll give you the answer.

As gollyg said - the answer will be found in whichever theme location folder your active theme is in. That'll give you the answer.

Me, I'm guessing that your particular answer will be yourtheme/block.tpl.php

But the general answer to your question would be different depending on what your actual question was. The HTML that makes up any page can come from many different places. Usually, as gollyg said in your theme

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

sgprs’s picture

I think you should be looking in your css... if i'm clear about what you're wanting to do. I am assuming you're referring to the gray line/bar over the ads. If so, I believe it should be controlled in your theme css or system.css, it's most likely an image. The html file is usually located in your main theme file, but as everybody said, it can be in another location depending on your theme. Just check your theme file, look for page.tpl.

And again, I believe you'll find what you need in your css, not your html. It takes extreme patience, but if you dig around, you'll get what you need. Drupal is awesome!

Chris
South Georgia Paranormal
www.theparanormalsociety.org