Friday, 15 March 2013

php - Drupal Preprocess/Hook Confusion -



php - Drupal Preprocess/Hook Confusion -

i'm having difficulty grasping semantics in implementing hook themes, , consequently understanding way in preprocess/process functions created. i'm using "the definitive guide drupal 7", states(technically) next code should implement/define/ , output theme function.

/** * implements hook_theme(). **/ <?php // core/module_urtheme() - kiwi themesname function node_kiwi(){ homecoming array( 'addblock' => array( 'block' => 'content' ), ); } //define theme_functionname/ should theme_addblock? function kiwi_addblock($block){ homecoming '<div class="kiwi-block">'.$block.'</div>';} //use print theme('addblock',$block)

my problem lies in utter confusion in regards syntax preprocess functions have:

<?php /** * implements template_preprocess_themehook(). */ function hook_preprocess_themehook(&$variables) { // changes go here. }

ultimately i'm aware both hook , themehook placeholders, should replace them, hook module/template/theme? themehook - function's name/the theme/? tried comparing the theme hook implementation above, made me more confused. apologize in advance naive mistakes might have made/said. , help much appreciated :) .

as far know, hook name of module or theme, , themehook hook defined within hook_theme(), typical ones "block", "node"... etc. example: yourmodule_preprocess_node(&$variables).

php drupal-7 drupal-modules drupal-theming drupal-hooks

No comments:

Post a Comment