By sheraz4pro on
hi i am new to drupal, i am creating a theme, i want to create theme header and footer separately and include them in each page. in custom php we just create 1 header and footer.php files and include them with the include() function. now please guide me whether i have to include them as in custom php or is there any other way to do this in drupal.
Comments
I'm not sure if it's the
I'm not sure if it's the 'correct' way but I'd create a separate theme for your header and footer files, implement hook_preprocess_page in your template.php file and add the header and footer as page vars, something like this:
Then you can output the variables just like any other in your page.tpl.php file:
i have created a header file
i have created a header file my_header.tpl.php in themes folder.
then in template file i put following code in the template file
now i am using to display it in page.tpl by using this line of code
but its not displaying anything :(
I'd guess you haven't
I'd guess you haven't registered your theme function in hook_theme, documentation is here:
http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...