I notice that the CCK fields all get themed with cck/theme/content-fields.tpl.php.

I have created a custom template file (node-pmproperty.tpl.php) that is "setup" by a preprocess function in my template.php. All of that is working.

What I would like to know is:
How can I create my *own* "content-fields.tpl.php" so my fields can be themed similar to the way CCK normally themes the nodes?

I would even settle for them just getting themed with content-fields.tpl.php but it seems there must be a way to do what I want.

I'm still wrapping my brain around theming and am probably at the deep end of the pool without a life-preserver...

I tried this in my node-pmproperty.tpl.php (thinking it would "theme" the fields):

print drupal_render($form['field_phonemain']);

and it output nothing, whereas if I do this:

print $field_phonemain;

it outputs the phone# as I would expect (albeit very "raw" and without any surrounding divs or classes and such)

I'm sure I'm just missing something...I have read every page of the CCK docs I can find as well as many pages on the FormAPI and most of the Theming Guide...(of course, sometimes I get confused when I wander into a 5.x doc and then try to apply it to 6.x....I know some of the docs apply to both, but don't always figure that out until I try it and then find a post somewhere that says "that won't work"...)

Thanks for any help.
Andrew.

Comments

adf1969’s picture

I figured it out.

I found there are _rendered properties that I can use.

I still don't know how to *create* what is in those fields (on the fly) but at least I can get their value.

I also figured out how to override the content-fields.tpl.php so I can make mods there too.

Andrew.

mikeque’s picture

It would be helpful if you show a snipped of code or give a little more info on how you solved it.
Thanks