Calling $node vars inside omniture.inc?

smacphail - April 9, 2009 - 21:21
Project:Omniture Integration
Version:6.x-1.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi there,

I'm just wondering how all of you are using this module? Figured out how to get the omniture.inc file working, define my vars and such, but everything has to be static it seems. The include file doesn't seem to have access to the $node object or much of anything else, like $title, etc.

That is, this:

<?php
function omniture_variables($main) {
  
$omniture_variables = array(
   
's.pageName' => $title
  
);
   return
$omniture_variables;
}
?>

...doesn't return anything for s.pageName.

I saw over here - http://drupal.org/node/182719 - that that user was defining some variables somewhere and then referring to them in the omniture.inc file (I guess). Where was that being done and how were the vars being picked up by in the omniture.inc file? Was he making globals inside template.php or something?

Thanks in advance!

#1

cytefx - August 10, 2009 - 16:06

Hi

if you replace this line

's.pageName' => $title

with

's.pageName' => drupal_get_title()

That should return you what you need.

John

#2

greggles - August 11, 2009 - 18:25
Status:active» fixed

I think cytefx has nailed this one - thanks!

I also suggest, in general, to use the 6.x-2.x version and create a custom module using the hook mechanism rather than the "inc" mechanism.

#3

System Message - August 25, 2009 - 18:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.