Generic topic
Theme a CCK input form for CCK2
Spending several days for me to find out how to theming Input Form in CCK2 on Drupal 6, hope this can help you and save your time.
To theming CCK2 Input you just need:
-
Edit template.php
Create node-content_type-edit.tpl.php
Clear Cache Data before view your result: Administer-Site Building-Performance: Clear Cache Data
EXAMPLE
Suppose your content-type is: "account_registration" and you theme is "bluemarine"
-
Edit template.php, add this:
<?php
function bluemarine_theme($existing, $type, $theme, $path) {
return array(
'account_registration_node_form' => array(
'arguments' => array('form' => NULL),
'template' => 'node-account_registration-edit'
)
);
}
?>//To REMOVE Title field
<?php
unset($form['title']);
?> Company Data
<?php
//NOTE: if you don't have Field Group then simply type:
// print drupal_render($form['field_accreg_company_name']['0']['value']);
print drupal_render($form['group_company']['field_company']['0']['value']);
print drupal_render($form['group_company']['field_street']['0']['value']);
?>Testimonials
Here’s just some of the comments we’ve received from themers who have used Zen as their base theme.
This theme saved me at 2am. Three hours of messing with 1000+ lines of nasty Garland-adapted code later, I abandoned it and recoded the site as a Zen sub-theme in under an hour. Thank you, thank you, thank you.
- Greg
If you are a designer and haven't used Zen yet - do yourself a favor and learn it.
- setfree
It has been a while since I have looked at the Zen theme [Zen 5.x-0.6] and have always crafted my own from an early rework of Garland. I listened [about Zen] on the Lullabot podcast and decided to take a look at Zen again. Wow, what an improvement. I am actively reworking my current project as a Zen subtheme and it is working great.
- Derrick
Just wanted to give you some props for making my life vastly easier than it would have been without Zen.
Cheers, Corin
Drupal 6 theme guide
The following pages cover theming in Drupal 6 and beyond.
For information on theming previous versions of Drupal, see the Drupal 5 and Earlier Theme Guide.
There have been important changes to the way themes are implemented in Drupal 6. For an overview of those changes and for information on upgrading a theme to Drupal 6, see the Updating Your Themes page. This handbook will also note differences from the previous approach where appropriate.
For module developers who wish to make parts of their module themeable, start with Using the theme layer (Drupal 6.x). This explains the other end of the theme process - declaring what can be themed and how.
Note to documentation contributors. This guide contains general information about theming (along with some references to specific core modules and themes). Please don't add information about contributed modules or themes.
