Once again, how can I theme content_profile?
I've read README, but it didn't explain everything clearly.

I have two content types for users. I've created node-type1.tpl.php and node-type2.tpl.php.
This:

echo $content_profile->get_variable('profile', 'title');

doesn't seem to be showing anything. If I put this piece of code to to user-profile.tpl.php it shows the title as it supposed to.
So, it basicly means I have to theme content_profile content types through user-profile.tpl.php?

Comments

Equ’s picture

Ok, I guess I have to use user-profile.tpl.php :-) I have two roles as I mentioned above. Is this how I'm supposed to theme my user-profile?

<?php if (isset($account->roles[3])): ?>
//theming code for role 3
//...
<?php endif; ?>

<?php if (isset($account->roles[4])): ?>
// theming code for role 4
//...
<?php endif; ?>

Thanks in advance.

Equ’s picture

Someone please tell me if this (the approach above) is right or wrong.

Bilmar’s picture

Hello,

I would be very interested in learning about this as well.
Would it be possible for anyone who can help to document some steps for those unfamiliar with coding in this thread?

I also will have 2 different roles with different fields.
Also, I would like to edit the content profile edit layout as well.

Thank you very much in advance!

Michelle’s picture

You folks really should take a look at Panels. It makes this sort of thing much easier.

Michelle

Bilmar’s picture

Hello Michelle-

I create the content profile page with panels but was only able to achive something very basic (most likely because I am not familiar with the advanced methods of styling it?)

I am currently coding a design in css/html and would like to add the necessary code into it so as to use it as the template for the content profile node for all users.

I would like to learn the php codes to put the fields in content profile into the profile edit page / as well as the php codes to place it on the profile view page.

Could you or someone please assist?

Thank you!

Michelle’s picture

Not me. I use Panels. Good luck, though.

Michelle

Bilmar’s picture

Hi again Michelle,

Could you please refer me to guides for advanced panels designs/usage?
Also, ways to theme panels to match the rest of the site theme?

Thank you!

rajmataj’s picture

I have been searching for a way to theme this as well and an excellent way is to use the Contemplate module. Use its editor to create or edit markup for your CCK fields used in Content Profile, and without saving the generated template code from within the Contemplate interface, instead copy the markup code and paste it into your node-your_content_type.tpl.php file. Makes life with Content Profile markup much, much simpler.

Here's an article to help you get going with this combination: http://www.davidnewkerk.com/book/23