Parent Items and Weight
In the administration system, the terms parent item and weight often remain hidden, because Drupal uses a drag-and-drop interface to rearrange items. Nevertheless, there are some screens where you will need to understand their meanings. Both taxonomy and menus may rely on hierarchies for their organization. When items are organized within a hierarchical sorting system, Drupal uses the term parent item to define which taxonomy term or menu item is closer to the top of the family tree. When you...
Page Content Drupal Messages and Help Text
Content is the most important part of your Web site. You must tell Drupal where to insert content into the page template This is done with a simple variable, content. You may place this variable anywhere in the template file page.tpl.php. From this simple variable, Drupal may present a single node, or a list of nodes, or whatever else Drupal may prepare as the content for any given page. You must also print the title for this content using the variable title. It is different than the variable...
Adding BlockEditing Capabilities to a Theme
If you have chosen a different parent theme as your subtheme, you will not have access to the Zen Edit block function. Moving the functionality from the Zen theme to your own theme is not difficult, however, and requires only careful copying and pasting. Follow these steps to merge the necessary Zen functions into your own theme 1. Open the Zen theme file template.php and copy the contents of the function zen_preprocess_block. 2. Open your own theme's file template.php and look for the function...
Converting a Drupal x Theme to a Drupal x Theme
Drupal themes have changed radically from version 5 to version 6 however, there is no reason to change the design of page that is displayed to Web site visitors when you upgrade the theme from one version of Drupal to another. Keeping this point in mind, you should find it a relatively quick task to upgrade a theme with only a few minor changes to your current theme files. Work through the following checklist to create a Drupal 6 theme 1. Create an information file for your theme. This file...
horizscrollhtml
The horizscroll.html file contains the HTML code that allows the JavaScript code from horizscroll.js to attach its behavior. It also contains all variables for the data source. lt xml version 1.0 gt lt DOCTYPE html PUBLIC - W3C DTD XHTML 1.0 Strict EN lt html xml lang Men lang en gt lt head gt lt meta http-equiv Content-Type content text html charset utf-8 gt lt link rel stylesheet href horizscroll.css type text css gt lt script src jquery.js lt script src drupal.js lt script src horizscroll.js...
Personal Themes
If your Web site is already live, you may want to enable your new theme privately to test its implementation before showing it to the rest of the world. To do so, you can use the Personal Themes feature of Drupal. It allows you to enable a theme that only you can view. Once the theme is working correctly as a personal theme, you can apply the theme to the entire Web site for everyone to use by following the instructions in the previous section. If you are not the main administrator for the site...
Form Candy
You may have heard of eye candy It is something that is remarkable for its visual appeal, but not necessarily its demand on your intellect. Analogous to eye candy, form candy consists of Web form enhancements that are remarkable for their visual appeal. These elements may also help users to edit content. This section is dedicated to the modules, CSS tricks, and theme configurations that will take your forms from boring to zippy and fun. Like kittens with a ball of yarn, your editors will enjoy...
skeletonjs
The skeleton.js script file provides a basis on which you can build your own JavaScript components for Drupal. The script is initialized in the Drupal.behaviors. skeleton function and creates a new behavior instance for each component found in the HTML source code. Initializes the skeleton component. Drupal.behaviors.skeleton function context context .each function lt lt lt Insert the code to process each skeleton here gt gt gt .addClass 'skeleton-processed' You should document all available...
Custom Error
One of the disadvantages of using the built-in Drupal error-handling techniques is that the error pages are actual nodes in the database. As a consequence, they may show up in search results pages. An alternative to this approach to error handling is to use the Custom Error module. This module can be downloaded from the project page at http drupal.org project customerror. Instructions explaining how to install modules can be found in Appendix A. Once the Custom Error module is installed, you...
Calling the Server with XmlHttpRequest
You almost certainly have heard of AJAX, a term coined in 2005 for the process of loading data within the lifetime of a Web site. AJAX makes it possible to develop Web sites that change their content dynamically without needing to preload all possible content or resorting to reloading the page. AJAX, which stands for Asynchronous JavaScript and XML, is based on the XmlHttpRequest technology introduced by Microsoft in Internet Explorer. XmlHttpRequest was originally created to facilitate the...
Disqus
Disqus pronounced discuss is a service and tool for facilitating web comments and discussions. The Disqus comment system can be plugged into any Web site, blog, or application. It makes commenting easier and more interactive, while connecting Web sites and commenters to create a thriving discussion community. Disqus makes it easier for people to comment and track their contributions on a single profile, which they can display as a comment blog. After all, there really is no difference between a...
Structure of the preprocessblock Function
The function preprocess_block receives a copy of all ofvariables prepared by Drupal for blocks vars . This list includes everything its ID, the module that created the block, the region where the block should appear, and the title of the block . In addition to blocks, special preprocess functions are available for pages, blocks, and nodes. To obtain a full list of all variables created by this block, issue the following PHP command inside the preprocess function to print the variables to the...
Applying a Separate Administrative Theme
Content managers and Web site administrators may be accustomed to having a visually distinct management area within the Web site that looks very different to the public Web site. By default, Drupal uses the same theme for both the administrative and public versions of a Web site. This behavior is unlike that of other Web publishing platforms. For example, WordPress uses an administrative dashboard with a distinct view site link near the top of the page. In Joomla , the administrative area is...
