Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dru_india on
hi
i am trying to add my tpl.php for node/add/content-type .i have done this thing in drupal 5 by use PHPtemplete function but it is not working in drupal 6
can any one help
Comments
Use module theming function
It depends how you want to do it.
I've written a custom module to support a new node type called "course" (for golf courses), and wanted part of the data entry form to be laid out as a table. There are two pieces to making this work:
I've written an implementation of hook_theme:
then the theming function itself:
Checking the documentation on hook_theme, it looks as though you should be able to add a "template" element to the array in your hook_theme implementation to tell it to use a template file if that's more suited to your particular theming requirements:
You would then need to create a node-course-edit.tpl.php file in your theme directory. I haven't tried this, so it may still be missing something, but it should at least get you on the right track.
Thanks
Thanks it worked
Is not working to me; I tried
Is not working to me; I tried this very simple example in my template.php:
what I'm doing wrong?
ok, if I set up a template it
ok, if I set up a template it works:
(template.php)
(ccktype.tpl.php)
For those that are trying
For those that are trying this but are having issues or for some reason the 'code isn't work', make sure you clear your template cache.
Also, here is a good article that kind of spins off from this same discussion:
http://adaptivethemes.com/using-hook-theme-to-modify-drupal-forms
James McBryan
Founder & Technical Lead
Twomile - http://www.thetechscouts.com
"Technical Guides for Social Good"
$form variables in template file
To access the $form variables inside a template, you still need the theming function in the template.php even if its just
Hi , I'm using
Hi ,
I'm using themename_theme() in my template.php file to add custom node add form. But the same form get loaded for the node edit form as well. How can i used two different templates for node's add form and node's edit form?