User login
Drupal is an open source content management platform
Equipped with a powerful blend of features, Drupal supports a variety of websites ranging from personal weblogs to large community-driven websites.
The theme system

This text is automatically translated, just for example.
Functions and templates that put the contents of the visitor, and which can be implemented in the theme of the site.
The level of representation Drupal is implemented as a modular system - the level of the theme (theme layer). Each theme controls almost all output from Drupal, and has full control over the CSS.
Inside Drupal, the level of the theme is implemented using the function theme ( ) which transmits the name of the components of the theme (the theme hook) and the arguments. Example: theme ( 'table' , $header , $rows )
Also, the function theme ( ) may contain an array of theme hooks that can be used to implement the "fallback" (using built-in features the theme, unless it found a more specific hook), to better control the output. Example: the function theme ( array ( 'table__foo' , 'table' ) , $header , $rows ) try to find a hook 'table__foo' and if it finds, it will use built-in function temizatsii 'table'
This feature can be used to connect the specific functions of the theme to the named object, giving the designer-authors of the greater control over the output of specific types of content.
Starting with version 6 Drupal, each hook temizatsii defined in the module, you must register in this module to Drupal knows where to find this hook, and to simplify the search topics and the modification of these hooks.
Hooks temizatsii recorded in hook_theme ( ) This hook should return an array of descriptions temizatsii hooks that are implemented in this module. Each of the descriptions in its turn is an associative array. Must be described by the parameters that are required for each function or template level topics as well as default values for all these parameters. If the hook temizatsii realized as a function, then by default it is called theme_HOOK ( )
Each module must provide an implementation for all hooks temizatsii which he registers. Implementation can be either in the form of a function, and as a template, the implementation of function should be indicated in hook_theme ( ) Under the agreement is considered that the implementation of hooks temizatsii in the form of functions should be called theme_HOOK ( ) Implementations hooks temizatsii as templates must be in the same directory with the module that defines these hooks.
The standard Drupal template engine simply executes the template as a PHP script and returns the result. Engine so Drupal can be extended by adding support for alternate handlers patterns such as XTemplate, Smarty or PHPTal. The most common theme Drupal using engine called PHPTemplate (included in standard delivery Drupal, file phptemplate.engine), using a standard template engine Drupal.
In order to implement their own version of the theme of a hook temizatsii, you need to override the hook as a function or template. These cover the implementation of the implementation of the default hook. In the «clean» the subject (topic, not using any engine order) should be in your theme to implement hook hook_theme ( ) and tell it all about Drupal hukah temizatsii that issue sells, and in subjects using sliders to hooks temizatsii named accordingly, are recorded automatically. Agreement under the name Hooks may depend on the engine so, but most follow a standard set by PHPTemplate: the function must be called ENGINE_HOOK ( ) (in the case PHPTemplate - phptemplate_HOOK ( ) or THEMENAME_HOOK ( ) For example, the engine PHPTemplate will search for the implementation of the hook 'table' in the standard Drupal theme (Garland) in the functions phptemplate_table ( ) and garland_table ( ) Syntax ENGINE_HOOK ( ) is preferable, since the functions with names will be visible and sub-themes of (those with a common code but different style sheets).
The theme system is described and defined in theme.inc.
- Login to post comments
Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Tens of thousands of people and organizations are using Drupal.
Generic comment. Each Drupal module should provide a default implementation for theme_hooks that it registers. This implementation may be either a function or a template; if it is a function it must be specified via hook_theme(). By convention, default implementations of theme hooks are named theme_HOOK. Default template implementations are stored in the module directory.