GithubHelp home page GithubHelp logo

patrickpeng2091 / dgd7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacine/dgd7

0.0 1.0 0.0 198 KB

Example theme for two theming chapters in "The Definitive Guide to Drupal 7." See all of the code released with the book here: https://github.com/definitivedrupal/dgd7

Home Page: http://definitivedrupal.org

Ruby 0.75% CSS 66.97% PHP 32.27%

dgd7's Introduction

What's here?

This theme was created to accompany the theming chapters (15 and 16) in The Definitive Guide to Drupal 7. It's currently running on http://definitivedrupal.org and includes examples of:

  • General setup and customized Global Theme Settings (see pages 275-281).
  • Custom region implementation (see pages 282-292).
  • Template file overrides (see pages 293-301).
  • Theme function overrides (see pages 301-304).
  • Theme hook suggestions implementations (304-310).
  • Preprocess and process function implementations (see pages 313-321).
  • Alter hook implementations (see pages 321-327).
  • render(), hide(), and show() (see pages 327-329).
  • Advanced loading and removal of Stylesheets (see 341-347).

You can purchase the book, which contains way more than a couple of chapters on theme development here: http://definitivedrupal.org/purchase. It's over 1,000 pages, was written by lots of Drupal rockstars, and covers so many aspects of Drupal 7 development.

Disclaimers

I am NOT a web designer

This is probably really obvious from viewing the site. This theme was created with 3 goals in mind:

1. Illustrate as many useful theming examples as possible.
2. Make it look decent.
3. Have fun with CSS3 and not care at all about older browsers.

It's not perfect, and doesn't claim to be, but if you are trying to learn Drupal 7 theming in more detail, it should be helpful.

Sass/Compass

The CSS in this theme was written using Sass and Compass. The source is located in the "sass" directory and is ultimately complied into the "css" directory. In this case, existing code was quickly converted to Compass syntax, because I hate writing CSS3 without it and it's got lots of awesome utilities that make it a lot easier and faster to write CSS in general. Unfortunately, the time that I can spend on this has run out, but if I were to continue working on this theme (or had used SASS from the start), I would have made partials, mixins, sprites and more variables.

To learn more about using SASS and Compass + Drupal, I highly recommend checking out all of the following resources:

Mobile Friendliness

While this theme contains media queries that manipulate the layout so that it is easier to read on small screens, it's by no means meant to be an example of how to create a complete and robust mobile experience or responsive design and doesn't work where media queries are not supported. It's just a quick attempt to make it more mobile friendly as others have done: http://bit.ly/n3kqsJ.

To learn more about making mobile friendly and responsive websites, here are some good resources and some code:

More documentation

There are many resources available, some of which are linked throughout the code comments and in this file. There's also plenty of official documentation on http://drupal.org:

Tools

Below is a collection of the tools/apps that I use on a daily basis and find invaluable. Maybe you will too.

General

  • This theme was partially written in TextMate and Espresso on Mac OS X.
  • I use Google Chrome for development.
  • I use LiveReload to automatically refresh my browser windows while I code.
  • I use MAMP for my local development environment.
  • I use xDebug which gives very helpful stack traces when an error occurs.
  • I use VMware Fusion and 3 virtual machines for cross-browser testing.
  • I use VirtualHostX to easily setup local sites.
  • I use Tower for version control.
  • I use Colloquy to hang out and chat with other developers and frequent #drupal, #drupal-contribute, #drupal-html5 and #html5 on IRC.

Drupal-specific

  • I use Devel religiously while theming to print the contents of arrays/objects using dpm().
  • I use Drush constantly during development (especially to clear the cache).
  • I use the Design test and Style Guide modules which contain test pages with lots of different output to help ensure that I don't miss styling anything important when creating themes.

dgd7's People

Contributors

jacine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.