Creating Views 3 Programmatically
In this chapter, we will switch from the admin user interface to code, creating a view within a module and other examples of using code in conjunction with Drupal and Views architectures to manipulate the content. These methods should only be considered if you are comfortable with PHP and the Drupal architecture and API. The benefits of using code include more granular control, as well as the ability to achieve behaviors otherwise unavailable. The drawbacks are that the Views environment can be very complex, and one can easily break the environment.
The differences between using the Views UI to create a view and doing it in a module is that the UI does the coding for you and makes it more convenient to make changes to the view afterwards. That said, the UI method does not make it easy to distribute a ready-made view, nor does it make it facilitate tying such a view to other code.
In this artice by J. Ayen Green, author of Drupal 7 Views 3 Cookbook, we are going to cover the following topics:
- Programming a view
- Handling a view field
- Styling a view field
- Fine tuning the query
Tabula Rasa: Nurturing your Site for Tablets
The Drupal Mobile Web Development Beginner’s Guide follows a humble ‘Mom & Pop’ restaurant website which gets a makeover complete with cutting edge features that play to mobile, tablet and desktop audiences. Restaurant websites are notoriously horrible to navigate and our Mom & Pop example is wellintentioned but no exception to this rule. We bring this site out of the early 1990’s with cutting edge development practices and a team development workflow. This pizza chain goes mobile with location services, audio, video, charting and mapping worthy of any multi-million dollar site.
In this article by Tom Stovall, author of Drupal 7 Mobile Web Development Beginner’s Guide, we'll:
- Examine touch events and go over the differences between touch events and mouse-click events
- Learn to add touch events to our jQuery cycle on the home page
- Take a look at the adaptive web page designs and begin the process of adapting a design for three layouts—phone, tablets, and desktop
- Learn to set the viewport with JavaScript
Setting up an online shopping cart with Drupal and Ubercart
In this article by Trevor James,author of Drupal 7 Business solutions we install and configure the Ubercart module for Drupal 7 in order to set up an online store and e-commerce system for our client who owns a bakery called Artisan Bakers Collective. Our client wants to offer their baked goods and other products online so their customers can order and pay for their bread and other baked goods ahead of time and then pick them up in the store. Follow along as we set up a basic Ubercart driven e-commerce system in Drupal 7.
Read Setting up an online shopping cart with Drupal and Ubercart in fullDrupal 7 Social Networking: Managing Users and Profiles
Social Networks are a relatively new aspect to the Web that are really taking off. Many businesses, organizations, communities, and families are using social networking to promote themselves, communicate better with others, and to engage with their audience. This article uses Drupal, a powerful and extendable Content Management System (CMS), to set up and manage a social networking website.
In this article by Michael Peacock, author of Drupal 7 Social Networking, we will learn:
- How to manage users, roles, and their permissions
- About Gravatars and how to enable them
- How users can track the activity of each other
- How to extend user profiles
- About settings and rules for users
- How to give authenticated users a more relevant home page
Drupal 7: Customizing an Existing Theme
This article by Ric Shreves, author of Drupal 7 Themes, focuses on sub-theming. The article covers how to quickly and easily build a proper sub-theme and then how to use that sub-theme to create a customized look and feel for a Drupal site. Through the implementation of a sub-theme, the themer is able to leverage the power of an existing base theme while retaining the flexibility needed to customize virtually every element of the styling and the structure.
For the purpose of illustrating the examples in this article, we'll be using the Bartik theme, which is included in the default Drupal 7 package. Among the topics we will cover:
- Selecting a base theme
- Creating a sub-theme
- Customizing your sub-theme
Drupal 7 Themes: Dynamic Theming
The Drupal system, backed by the powerful PHPTemplate engine, gives you the ability to create logic that will automatically display templates or specific page elements in response to the existence of certain conditions. This article by Ric Shreves, author of Drupal 7 Themes, reviews different techniques available for creating templates that are responsive to the conditions on the screen.
Among the techniques covered in this article are:
- Working with the Administration theme
- Using template suggestions to control display by page, node, or block
Drupal 7 Themes: Creating Dynamic CSS Styling
Not only can you make the display of templates and elements dynamic, but you can also tap into similar logic for your CSS styling. This article by Ric Shreves, author of Drupal 7 Themes, reviews different techniques available for creating styles that are responsive to the conditions on the screen like the content being displayed, or the user viewing the content.
Among the techniques covered in this article are:
- The use of $classes to create dynamic CSS styling
25 Useful Extensions for Drupal 7 Themers
This article by Ric Shreves, author of Drupal 7 Themes, looks at software tools that can aid theme development. The article includes a list of Drupal modules that are useful to themers as well as third-party tools that can make the job faster and easier. Each tool is listed along with a brief synopsis and a URL to the relevant project site. This list should not be viewed as an endorsement of any particular module or product over any other; it is simply an attempt to help you discover some of the tools that are at your disposal.
The tools listed here fall into two categories:
- Drupal modules
- Non-Drupal third-party software
Using JavaScript and jQuery in Drupal Themes
Until a few years ago, mentioning the word JavaScript to a themer would usually result in groans about inconsistencies in browser support, lack of standards, difficulty in debugging, and a myriad of other complaints. Thankfully, however, things have changed considerably since then. Browsers have evolved and standards have improved. JavaScript is now a potent weapon in any themer's armory and this is especially true with the introduction of cross-browser libraries and frameworks which address most of the aforementioned issues with it.
In this article by Karthik Kumar, author of the book Drupal 6 Theming Cookbook, we will be covering the following recipes:
- Including JavaScript files from a theme
- Including a JavaScript file only for certain pages
- Giving the username textfield keyboard focus
Drupal Intranets with Open Atrium: Creating Dashboard
The dashboard is a central place to view a snapshot of the activity happening within your departments. This article will explain the three different types of dashboards and how to add custom content to a dashboard.
The article by Tracy Charles Smith, author of the book Drupal Intranets with Open Atrium, is divided into the following five sections:
- Main dashboard
- Group dashboard
- User dashboard
- Modifying Layout
- Boxes




