Let’s talk about taking your image uploads and turning them into unique shapes with fabulous effects using the ImageCache Actions module.
We already know that being able to set a standard for image display creates consistency and a better user experience. Drupal comes with the ability to do basic image manipulation like resizing them. By downloading and enabling another module, ImageCache Actions, we can do fancy things to those images, making your display truly customized.
I am assuming that you already know how to create Image Style presets.
For this tutorial, you need to make sure the Image module that comes with Drupal Core and you also need to download and enable the ImageCache Actions module. This can be found at drupal.org/project/imagecache_actions.
This video walks through how to use the new hook_page_alter()
in Drupal 7 by transforming an unordered list into an ordered list. Because all of the content, region & blocks are stored within a renderable array before being output to the page, then this new hook allows modules and themes to make changes to page before it is fully rendered.
This video walks through the basic use of Drupal 7's Render API for outputting content, and gives some hands-on experience in navigating and working with renderable arrays. We expand the Menu Magic module by creating several different kinds of page elements to show how renderable arrays work.
This chapter goes through the process of passing a wildcard variable to a function via an argument from the URL. It creates a MENU_LOCAL_TASK tab on the node which inverts the text to display upside down. It uses a page callback function that is included within a separate file in order to save on how much memory is used.
In this video you'll learn how to use api.drupal.org the canonical source for information about Drupal's hooks, APIs, and code documentation in order to find out information about implementing a particular hook, making use of a particular function or library of functions, and even gaining a better understanding of some of the big picture concepts behind Drupal's code and APIs.
Walks through some of the basics elements that are required and common for all Drupal modules. Then we create a simple demo module to see how it works.
This chapter describes how Drupal modules are able respond to specific events through the hook system. A couple of example hooks are implemented in order to see how this process works. This video builds on the demo module we created in the previous chapter.
It is very time consuming and error prone to repeat "click steps" among multiple sandboxes, development and production in order to get your new image styles to appear. In this video, I will show you how to write code that turns your "custom" image style into a "default" image style so that you can use source control to update all of your site environments.
I am assuming you already know how to create image styles in the administrative interface. Familiarity with basic module development is helpful, but if you follow the techniques and patterns I demonstrate, you will successfully export your image styles into a new custom module.
This chapter explains hook_page_alter(), which is another alter hook new to Drupal 7 and to the theme layer. Each page rendered by Drupal is contained within an array where the theme is able to go in and rearrange, delete or duplicate specific page elements.
Additional resources
This chapter shows some general best practices for keeping your template.php file clean as well as making it easier for designers to work primarily with the template files when possible to avoid them having to make too many changes to template.php. Specifically, some HTML classes are removed from the ninesixtyrobots_comment_form() function in template.php and moved to the comment-form.tpl.php template file, which is specified as an option in the ninesixtyrobots_theme() function. The rendering logic is also removed from the theme function and into a preprocess function so that it can be passed in as a variable to the new template file.
Additional resources
The ability of having alter hooks within the theme layer starts to blur the line between the logic and presentation, and so there are a few things to be aware of when using hook_form_alter() from the theme layer. The biggest thing to know is that the form rendering process has already gone through the creation and validation preparation process at the module layer, and so you shouldn't be drastically changing the functionality of a form at the theme layer. This form alter hook at the theme layer is primarily for aesthetic clean-up, styling and additional design. This chapter gives some specific examples of things to watch out for.
Additional resources
There are four alter hooks that are now available to the theme layer in Drupal 7. This chapter walks through two of those hooks, hook_css_alter() and hook_js_alter(). These hooks allow the theme layer to reorder, delete or replace specific CSS or JavaScript files that are being loaded by Drupal core or other contributed modules.
Additional resources
In this video Joe Shindelar provides a quick overview of the minimum set of tools you'll need in order to get started with module development. Some kind of web server to host your development site on, an editor that allows you to edit PHP files (preferably one with syntax highlighting), a MySQL client, and Drush. Learn about how these essential tools fit in the module developers tool belt and then download and install a bare bones copy of Drupal to start tinkering with.
This lesson goes through the process of creating Theme Settings so that administrators of a theme are able to turn on and off specific features within the the theme, as well as specify other relevant settings.
Note: Twitter has recently shut down their v1 REST API so this lesson's site_slogan adjustment no longer works (it will always return no values because there is no API data found). The core concepts of how to create theme settings are still correct, you just won't be able to see the output from Twitter.
Additional resources
This chapter goes through the process of adding a specific form id to the theme registry with the hook_theme() function, which allows the creation of a new function that targets a specific form. Specifically in this chapter, comment_form is added to the theme registry so that we can create a ninesixtyrobots_comment_form() function in order to add a column to the comment form so that the name and subject fields are displayed side-by-side.
Additional resources
Provides an overview of what is covered in the Theming Basics series and gives a preview of what is yet to be covered within the Advanced Theming video.
Walks through the process of adding a screenshot to you theme so that it'll show up properly within the theme administration page, following the screenshot directions found on Drupal.org, and using the Skitch screenshot app (you can use whichever screenshot app you like).
Additional resources
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.