Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By brianpauljaus on
Please do not get mad at me if this is too simple or a dumb question. I am a competent web designer / developer with thorough knowledge of PHP, MySQL, Perl, HTML, CSS... etc. However this is my first day with Drupal. I created a new block called header but it did not update the default header of the site. I want to be able to get to the raw html code of the exisiting header and change as I see fit. I looked at the building blocks but again I did not see anything for the default existing header. Can someone please point me in the right direction ?
Comments
By header you mean logo, site
By header you mean logo, site name, mission statement or something else? Like the stuff inside
<head>
tag?The base template, I am
The base template, I am hoping is broken into blocks like header, footer, sidebar, body... etc. I just want to be able to manipulate the look and feel of the base elements that are a part of every page like Header, Footer... etc. Not looking to design a whole theme, just make basic mods to existing one.
ok on the right track
I found a file in the theme folder of the theme I am using. the file is called page.tpl.php. This looks lika valid HTML / PHP code that forms the page. However when I modified the code in this file it did not update on the site even after 50 times of hitting F5. So is this a refresh problem or is that not the right file ?
Hi, there are a lot of things
Hi, there are a lot of things to consider here. There are themes which are in the /themes folder of a Drupal installation - you should never touch these! You should never hack the core. If you want to modify these, then create a sub theme (http://drupal.org/node/226507). The logic of sub-theme is like inheritance.
Generally what we do is, we download a starter-theme (I Prefer http://drupal.org/project/zen) Then make a sub-theme from this. You can go through (http://drupal.org/documentation/theme) for detailed instruction on theming.
Anyway, again inside all these themes, you will find various template files - which you can edit to alter the block & page structures.
Thanks
To edit the header of my
To edit the header of my page, I go to my theme directory, which is example.com/sites/all/themes/custom/theme name. In this folder, I have page.tpl.php, node.tpl.php, header.tpl.php, nav.tpl.php, subnav.tpl.php, etc. the page.tpl file includes the header.tpl page, which includes both the nav.tpl and subnav.tpl. You are correct that these pages are simply HTML and PHP code, that you modify to do what you want. Depending on what I want to change, determines which file I need to go to.
As for the refresh, you could be looking at cached copies of the page (see /admin/settings/performance), or could have modified the wrong theme files.
You also have to look at /admin/build/themes to make sure certain elements of the theme are turned on, and at /admin/build/block to put the appropriate elements in the appropriate regions (of the appropriate theme), such as header, footer, left sidebar, right sidebar, content, etc.
Drupal has a fairly steep learning curve when it comes to theming, but it's worth it in the flexibility at the end.
html.tpl.php is usually the
html.tpl.php is usually the right file, more tips here http://drupal.stackexchange.com/questions/8210/how-to-edit-head-info-in-...