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.
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 Morellimichel@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@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@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
-- [ Drupal support list | http://lists.drupal.org/ ]
On Wed, Jul 15, 2009 at 8:00 PM, Brett Evanson brettev@gmail.com wrote:
I think what you are looking for is drupal_set_title()
it is used to set the page title isn't it ?
Hi. I have a content type and I need to change the node's title when the node is view-ed.
Where is my error ?
drupal cache may be causing this.
sivaji j.g ha scritto:
On Wed, Jul 15, 2009 at 8:00 PM, Brett Evanson <brettev@gmail.com mailto:brettev@gmail.com> wrote:
I think what you are looking for is drupal_set_title() http://api.drupal.org/api/function/drupal_set_title/6it is used to set the page title isn't it ?
html page title (tag <title>) and node page title.
But i was sure that in Drupal 5 I changed the node->title field.
M.
Brett Evanson ha scritto:
I think what you are looking for is drupal_set_title()
Thanks Brett.
M.