How to Edit a Drupal Template
- 1). Log in to your Drupal website to access the administration panel. Click on "Modules" in the top navigation bar and note the version listed next to your installed modules.
- 2). Download the "Theme Editor," "CTools" and "Views" modules from the Drupal website. Scroll down to the "Downloads" section of each corresponding page and right-click on the ".zip" link under the "Downloads" heading that pertains to your Drupal version, and choose "Save Link As". Save each file to an easy-to-find location, such as your Windows desktop. Make sure you save the ZIP file and do not extract it.
- 3). Return to your Drupal administration panel. On the Modules page, click "Install new module." Click the "Browse" button under "Upload a module or theme archive to install" and navigate to the location of your downloaded ZIP file. Select the file and click "Open." Click on "Install." A brief progress bar will appear, followed by a success message. Click on the "Enable newly added modules" link. You will be returned to the Modules page. Repeat this process to install the other module files.
- 4). Scroll to the bottom of the Modules page once you have returned from installing the final module. Check each box under the "Chaos Tools Suite," "Views" and "Theme Editor" sections to enable the features. You may not be able to check "Chaos Tools (CTools) Plugin Example," which is fine, as this option is not needed. Click "Save Configuration" when finished.
- 5). Click on "Appearance" in the top navigation bar. Next to each theme, you will find a new "Editor" link. Click that link to enter the theme editor. By default, the first file you are shown is the theme's "info" file. Scroll down until you see the list of theme template files.
- 6). Click on the filename link for "page.tpl.php." This template controls the structure of Drupal pages within your theme and is where you would add, edit or remove elements such as DIV containers or Drupal utility variables. You can also change CSS classes for each DIV if you intend to write custom styles. When finished editing, click on "Save & Enable Changes" to see your updated template immediately if the theme is currently enabled.
- 7). Repeat this process to edit the "style.css" and "layout.css" files. These style sheets define the positioning, style, images and colors of the primary theme layout. You may also edit any other style sheets included with your theme, as well as the "node.tpl.php". The "node.tpl.php" controls the layout of the content or posts.