I use Content Profile to display CCK field into a user profile. However, I would like to change the way the fields are displayed. The Themer Info tells me :
Template called: content-field.tpl.php
File used: sites/default/modules/cck/theme/content-field.tpl.php
Candidate template files: content-field-field_message-profile.tpl.php < content-field-profile.tpl.php < content-field-field_message.tpl.php < content-field.tpl.php < content-field.tpl.php
Preprocess functions: template_preprocess + content_preprocess_content_fieldWhen copying and twicking "content-field.tpl.php" as suggested into my profile folder, I can change everything. The file used is:
File used: sites/default/themes/mytheme/content-field.tpl.php
However, when using "content-field-profile.tpl.php" as suggested, Drupal ignores it and re-use the default one according to Themer:
File used: sites/default/modules/cck/theme/content-field.tpl.php
The same occurs with node: even though "node-profile.tpl.php" and "node.tpl.php" are proposed in Themer Info, "node-profile.tpl.php" is ignored.
File used: sites/default/themes/mytheme/node.tpl.php
Candidate template files: node-profile.tpl.php < node.tpl.php
Preprocess functions: template_preprocess + template_preprocess_node + content_preprocess_node + fieldgroup_preprocess_node + views_preprocess_node + zen_preprocess_node
What am I doing wrong?
Thanks in advance for your help!
Laurent
Comments
Comment #1
siiim commentedTry with this file : content_profile-display-view.tpl.php. It's in the modules directory, in the content_profile directory.
I've change this file (with some "if" etc,...) to display just what i wanted, and i created a template user-profile.tpl.php for the others stuff (user things).
It works for me
Ask me if you have some question or if you want me to show you my code.
I hope it will help you.
Sim.
(sorry for my english)
Comment #2
clapiotte commentedHi Sim,
thanks for your comment. Unfortunately, I would like to modify the way $content is "computed" (print with tables rather than lists, for example). I can do it through content-field.tpl.php but this overloads all calls to this function and I don't want to do that. I should be able to do it with content-field-profile.tpl.php" but it apparently does not work.
I'm still looking for a solution, but thanks for your help!
Laurent
Comment #3
Patroclas commentedHave you looked at the ConTemplate module http://drupal.org/project/contemplate ?
Not sure if it will do what you want but I have found it useful for display of these fields.
Comment #4
Anonymous (not verified) commentedHi Laurent
Are you following the instructions in the first comment on this page?: http://drupal.org/node/206980
In particular:
cheers
Nigel
Comment #5
clapiotte commentedThanks Nigel for your advice. This was the missing point: the unmodified content-field.tpl.php *must* be in the same folder as the modified content-field-profile.tpl.php so the last one is taken into account.
Also Patroclas thanks for your suggestion, even if not useful for thi particular issue, might be useful for other purposes.
Cheers from paris,
Laurent