Function address: hook_preprocess_hook
1 first explain the meaning of the hook_preprocess_hook HOOK:
Hook _ preprocess _ hook
[Module] _ preprocess _ [Theme hook name]
The custom Module name pre-processes the theme declared through hook_theme
2. Use
<? PHP // set the variable function custommodule_preprocess_custom_theme_name (& $ variables) {// Add a custom variables $ variables ['m M _ var'] = 'I am a custom variable ';} // use the echo $ custom_var variable in your topic template; or ECHO $ variables ['m M _ var'];?>
Notice
[Theme hook name] use the function (theme_get_registry () to check the number of registered topics in the current system.
3. Example
Custom_module_name_preprocess_node
Custom_module_name_preprocess_breadcrumb
Custom_module_name_preprocess_page
Custom_module_name_preprocess_comment
Functions of the same function: hook_process_hook