+ All Categories
Home > Documents > Static HTML to Drupal Theme By Ivan Zugec. Static HTML to Drupal Theme. Setting up a theme....

Static HTML to Drupal Theme By Ivan Zugec. Static HTML to Drupal Theme. Setting up a theme....

Date post: 02-Jan-2016
Category:
Upload: florence-fields
View: 231 times
Download: 2 times
Share this document with a friend
20
Static HTML to Drupal Theme By Ivan Zugec
Transcript

Static HTML to Drupal Theme

By Ivan Zugec

Static HTML to Drupal Theme.

• Setting up a theme.

• Overriding tpl files.

• Using the devel module.

• Q and A

Static HTML page

Required theme files and folders

1. Images folder

2. Page.tpl.php

3. .info file

4. Style.css

Where do we save themes?

sites/all/themes

.info file for your theme

; $Id$name = rgdesigncore = 6.xengine = phptemplateregions[left] = Left sidebarregions[right] = Right sidebarregions[content] = Contentregions[footer] = Footer

Regions

page.tpl.php file

Page.tpl.php

Replace this:

Page.tpl.phpWith this:

<title><?php print $head_title ?></title>

<?php print $head ?>

<?php print $styles ?>

<?php print $scripts ?>

Page.tpl.php

Replace this:

Page.tpl.phpWith this:

if ($logo || $site_name) { if ($logo) { print '<a href="'. check_url($front_page) .'" title="'. $site_title .'">'; print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" /></a>'; }print '<h1>'. $site_name .'</h1>';}

Page.tpl.phpif ($logo || $site_name) { if ($logo) { print '<a href="'. check_url($front_page) .'" title="'. $site_title .'">'; print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" /></a>'; }print '<h1>'. $site_name .'</h1>';}

<?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?><?php endif; ?>

Next regions

Left Side BarsWith this:Replace this:

<?php if ($left): ?> <?php print $left ?><?php endif; ?>

Right Side Bars

With this:

Replace this:

<?php if ($search_box): ?> <div class="block_menu"> <h3>Search</h3><?php print $search_box ?> </div><?php endif; ?><?php if ($right): ?> <?php print $right ?><?php endif; ?>

FooterWith this:Replace this:

<div class="center" id="f"> <?php print $footer ?></div><?php print $closure ?></body>

Content region

Important Variables<?php print $breadcrumb ?>

<?php print $messages ?>

<?php print $tabs ?>

Important Variables<?php print $title ?>

<?php print $help ?>

<?php print $content ?>

<?php print $feed_icons ?>


Recommended