Space web hosting - 162 CHAPTER 5 ADDING AND CUSTOMIZING THEMES

162 CHAPTER 5 ADDING AND CUSTOMIZING THEMES Table 5-4. Variables Available in block.tpl.php Variable Description $block The block object (see http://php.net/oop). The following $block-> variables are the standard fields of the $block object. $block->content The content of the block. $block->module The name of the module that is responsible for creating this block. $block->region Can be any of the regions defined in the phptemplate_regions() function: left, right, header, footer, content, as well as any custom regions that are defined in a theme_regions()function, if you have written one (see the Adding Custom Regions for Blocks section later in this chapter). $block->subject The title of the block. $block->delta A number given to the block by the module that produces it. $is_front A Boolean that will be true if the page being generated is the site s front page. $id An integer that uniquely identifies this block among all blocks on the page. $block_id An integer that uniquely identifies this block among all blocks of the same region. $zebra Alternates between the strings even and odd, in case you want to use alternating styles. $block_zebra Like $zebra, but is reset for each block region. The default block.tpl.php template, shown in Listing 5-1, can be found at themes/engines/phptemplate/block.tpl.php. Listing 5-1. Default block.tpl.php

module” ?>” id=”module-$block->delta”; ?>”>

subject ?>

content ?>

As you can see, the two visual elements being used are the block s title, $block->subject, and the block s content, $block->content. The rest is the HTML that goes around the title and content. Notice that the outer

tag has two class attributes: block and block-module (modulewill be the name of the module that produced the block). This allows the style sheet to address the block generically as well as specifically according to the originating module. Box.tpl.php The box.tpl.php file overrides the theme_box function to enclose content in a generic box, usually a
tag, along with a title. The box.tpl.php template overrides the standard theme_box function, found in includes/theme.inc. Table 5-5 lists the variables available in box.tpl.php.
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services

Leave a Reply