Takes a tour through some of the more useful template variables, and more ways of determining the available variables by adding the following code to a page template:
Walks through the process of copying the default node.tpl.php file from the core node module into the theme, and then customizing the output specific to individual in order to match the design. See how to add specific variables, when to use conditional if statements and the best way to debug and iterate through this process.
Additional resources
In this chapter, we add some sidebar and footer regions to the page via the .info files, and printing those new regions out in our page template file, adding some blocks to help with testing. We also talk about Devel and Krumo, and how we can use those to find out everything that is available in out page array, using the dsm() function. While inspecting out page array, we point out the differences between elements and properties within renderable arrays.
Additional resources
We'll go a step further with our preprocess functions and look at working with node variables, and how to limit new variables to only specific content types.
Additional resources
This video walks through the process of replacing static content in the page.tpl.php file with dynamic variables. Joe talks about the html.tpl.php file as well as pointing some of the important variables that should be included within the theme.
Additional resources
This chapter covers some really handy browser extensions in the process of theming. For Firefox, there's the Web Developer Toolbar for turning off and on JavaScript, resizing the browser window to different sizes, and inspecting elements. It also has the capability to test changes to CSS files in a format that is easy to copy and paste into the source file. We also show off the basics of the popular Firebug extension, and the equivalent functionality that is now built in to webkit-based browsers such as Safari and Chrome.
Additional resources
Continuing on our work with preprocess functions, we look at how to add a new variable for our template files to use. We also see how to change the output based on whether the user is logged in or not, and how to add a variable to the t() function.
Additional resources
In this chapter, we'll walk through some of the best practices for filling out a stock Drupal site so that you can start to have some dummy content generated by different users and tagged with different taxonomy tags. We'll step through creating content with the devel generate module, and then do some other site preparation tasks such as creating some menu items and adding a shortcut link to the performance page so that you can quickly access the clear cache button.
Additional resources
In this video we will look at overriding a theme function instead of working with the template files. We will be modifying the breadcrumb using theme_breadcrumb(). to do this we'll use the Theme Developer module to help us find what we're looking for, and then we'll walk through how to override.
Additional resources
Theme Developer module (Drupal.org)
960 Robots
In this video we will see how we can create our own preprocess function for a theme function (not just templates). We're going to use this to display the user's full name on the site wherever the the username would normally appear. We start by creating a full name field, and then show how to get this working on our site.
Additional resources
In this video we will look at how to add CSS and JavaScript to our site using drupal_add_css()
and drupal_add_js()
. We will also show using these functions to conditionally add the CSS and JavaScript, within our page preprocess function.
Additional resources
In this video we'll see how we can create our own template suggestions. We'll do this in our node preprocess function to create a new node template that will be used depending on the day of the week.
Additional resources
This video goes through some of the strategies for translating a design into a Drupal theme. We talk about the two approaches of adding the HTML to an existing Drupal theme template vs. inserting dynamic variables into the HTML provided by our designer. Throughout this video, we're going to be assuming that our designer has delivered the full HTML, CSS and JavaScript to us, and we'll be adding in the dynamic variables. In this process we start to look at the design and start to break it up into it's component Drupal parts and start to strategize for how to build out the site and implement the design..
Additional resources
Drupal 7 co-maintainer Angie Byron gives a overview of some of the new Drupal 7 features, themes and user interface. She is joined by Nate Haug, Jeff Robbins, Jeff Eaton and Kent Bye who also provide a lot of insights through dynamic conversation, questions, and a fast-paced, hands-on tour of the major highlights of the new Drupal 7 release.
This video walks through the new interface in Drupal 7 for enabling themes, setting them to be the default, and configuring the administration theme. It also walks through the process of downloading a contributed theme, and where to store it. Finally, it walks through the theme settings pages that provide a user interface for turning on and off specific options for a theme.
Additional resources
Field Templates
FreeIn this lesson we cover how you can do some powerful things with Display Suite in regards to field templates. Using the Display Suite GUI there are lots of configurations and offerings to get the markup just the way you want.
Additional resources
Display Suite is a module that controls the display of your notes, users, comments, and any entity that's available in your system.
In this video, I will cover the installation of the module and some quick overview of all the menu items that will be made available if you install Display Suite, through the three modules that are its components: Display Suite, Extras, and Search Display.
Additional resources
I am going to show you how you can upload an image of any size and it will automatically display as the size/style that you designate by editing the display field settings for your content type. We are going to add an image field to the basic page content type and set the node display to use medium size of 220 wide by 220 tall. Being able to set a standard for image display creates consistency and a better user experience. Site builders and content administrators will also have less work because you don’t need to cut all of your images before you upload them. Drupal does all the work for you!
Introduction to Omega 3.x
CourseSo, we now have all of our CSS and HTML in our sub-theme. In this lesson, we've moved over the remaining files that our theme will need, like the images folder, and our node template files. The last step to finish this theme up, is to modify our CSS to take advantage of the responsive framework we already have in place. To do that we'll:
- Review the theme files
- Look at our default CSS file
- See the responsive changes
We're in the home stretch with our theme, so let's make our CSS responsive and wrap things up.
You can download the final Ninesixty Robots Omega theme as a regular project from Drupal.org.
Additional resources
You can download the final Ninesixty Robots Omega theme as a regular project from Drupal.org.