[support] Change node title when node is viewed.
Brett Evanson
brettev at gmail.com
Wed Jul 15 14:30:11 UTC 2009
I think what you are looking for is drupal_set_title()
http://api.drupal.org/api/function/drupal_set_title/6
Brett
On Wed, Jul 15, 2009 at 7:47 AM, Michel Morelli<michel at ziobuddalabs.it> wrote:
> Hi. I have a content type and I need to change the node's title when the
> node is view-ed.
>
> I have created a hook_nodeapi() function in one of my module:
>
> function ostoni_admin_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
> switch ($op) {
> case 'view':
> if ($node->type == 'machine_new') {
> dpm("ecco");
> $node->title = t("Macchina nuova").": ".$node->title;
> }
> }
> }
>
> But when I view the node page I see the node's title without my
> modification.
>
> If I print the node's structure I see that node->title is changed.
>
> Where is my error ?
> I use acquia theme without modification.
>
> M.
>
> --
> Michel 'ZioBudda' Morelli michel at ziobuddalabs.net
> Consulenza sistemistica in ambito OpenSource.
> Sviluppo applicazioni web dinamiche (LAMP+Ajax)
> Telefono: 0200619074
> Telefono Cell: +39-3939890025 -- Fax: +39-0291390660
>
> http://www.ziobudda.net ICQ: 58351764
> http://www.ziobuddalabs.it Skype: zio_budda
> http://www.ziodrupal.net MSN: michel at ziobuddalabs.it
> JABBER:
> michel at ziobuddalabs.it
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
--
Brett Evanson
More information about the support
mailing list