Hi,

I'm trying to insert a custom title in my content_profile-display.tpl.php. The reason is that I would like users to be able create their own unique title for their user pages.

Previously in Drupal 5.x you could add the following in user-profile.tpl.php

<?php drupal_set_title($user->field_name1." ".$user->field_name2); ?>

I've tried drupal_set_title($node->field_name1." ".$node->field_name2); to no avail.

Any suggestions would be greatly appreciated.
Lilian

Comments

liliplanet’s picture

* bump* sorry ..

Has anyone perhaps been able to set the title on user pages using a cck field in content_profile?

Look forward to any reply, and thank you.

Lilian

archi’s picture

Hi,

You can try this module might it work for you.

It allows you to use content of cck field as a title.
http://drupal.org/project/auto_nodetitle

Thanks

liliplanet’s picture

Thank you archi,

Yes, I'm using auto_nodetitle, but in this case we need to set the title for the user page (which is not a node).

Look forward to any suggestions.

Lilian

archi’s picture

Hi,

You can try this,
http://api.drupal.org/api/function/hook_user/6

Here when $op is 'view' you can use drupal_set_title();