D7: Creating a starter theme – notes

This is notes for Drupal 7 theeming.

The notes I made while creating a starter theme named plate_intl for the Restaurant Distribution based on Plate starter theme.

The procedure can be reused for creating any starter theme

  • Copy the base them to /sites/all/themes and rename the folder
  • Rename and edit the .info file
  • Optionally create an extra .css file with your extra styling
  • Edit the page template page.tpl.php

=== Theme ==============================================

– Copied /profiles/restaurant/themes/plate to
— /sites/all/themes
– Renamed /sites/all/themes/plate to
— /sites/all/themes/plate_intl
– Renamed /sites/all/themes/plate_intl/plate.info to plate_intl.info
– Edited /sites/all/themes/plate_intl/plate_intl.info:
name = Plate_intl
description = An international starter theme for the Restaurant Distribution based on Plate starter theme
….
regions[header_right] = Header Right
….
stylesheets[all][] = assets/stylesheets/screen-plate-intl.css
….
; Information added by rasor on 2013-12-29
version = “7.x-1.0-dev”
project = “plate_intl”
——-

– Created file /sites/all/themes/plate_intl/assets/stylesheets/screen-plate-intl.css

– Edited /sites/all/themes/plate_intl/templates/page.tpl.php – Added two regions and enabled more icons in footer (not used, yet):
<div class=”inner pull-right”>
<?php if ($main_menu): ?>
<nav id=”main-menu” class=”main-menu” role=”navigation” style=”float:left”>
<?php print render($main_menu); ?>
</nav> <!– /#main-menu –>
<?php endif; ?>

<div class=”header-right” style=”float:left”>
<?php print render($page[‘header_right’]); ?>
</div>
</div>
….
<footer id=”footer” class=”footer” role=”footer”>
<div class=”container”>
<div class=”footer-links row-fluid”>
<!–
<div class=”span3″>
<h4><?php print t(‘Rate Us’); ?></h4>
<h3>
<?php print ‘<a href=”‘ . restaurant_base_get_settings(‘twitter’) . ‘”>’; ?>
<?php print t(‘Ratings on TripAdvisor’); ?><i><img src=”#”></i></a>
</h3>
</div>
–>
<?php if (isset($footer_links)): ?>
<?php print $footer_links; ?>
<?php endif; ?>
</div>
</div>
<div class=”footer-bottom row-fluid”>
<?php print render($page[‘footer’]); ?>
</div>
</footer>
——

– admin/appearance – Enabled&SetDefault Plate_intl 7.x-1.0-dev
! Footer links disappered!!!!
– Edited /sites/all/themes/plate_intl/template.php

Renamed from: function plate_preprocess_page
to: function plate_intl_preprocess_page

Moved html out to page.tpl.php. Changed to:
$footer_links = ”;//'<div class=”footer-links row-fluid”>’;

Used twitter for TripAdvisor:
‘twitter’ => array(
‘title’ => t(‘Ratings on TripAdvisor’),
‘sub_title’ => t(‘Rate Us’),
‘href’ => restaurant_base_get_settings(‘twitter’),
‘icon’ => ‘icon-tumblr’,
),
// Icon names: http://fortawesome.github.io/Font-Awesome/3.2.1/icons/

– admin/config/development/performance – ClearCache

//Demo regions
– admin/structure/block/demo/plate_intl

– admin/structure/block – Language Switcher – Region: Header Right
— Configure – Block Title: <none>

The End.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: