replace node title in tab with cck field

joshua.howell - November 4, 2009 - 05:58
Project:Slider
Version:6.x-1.4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I have been trying to replace the node title in the slider tab with a cck image field which is attached to the node being displayed in the slider panels (a different icon for each slider panel). I tried using;

$node->field_icon[0]['view']
$vars['node']->field_icon
$vars['node']->field_icon[0]['view']

and a bunch of others variations but couldn't get it to work. I tried these variables in the slider.tpl.php and in slider.module but couldn't get anything to display. Could you please tell me what i am doing wrong or what is the correct way of replacing the node title with an image (which IS NOT set as a background property through CSS)?

#1

joshua.howell - November 15, 2009 - 21:21

Any suggestions please???

#2

joshua.howell - November 16, 2009 - 22:35

So i have been reading through the Themeing documentation and i think what i need to do is setup a variable in the template_preprocess_slider(&$vars) function to hold the datd for the image, is this correct?

I copied this function from slider.module and pasted it into my themes template.php file and renamed the function phptemplate_preprocess_slider but when i made change i ended up getting double output (two sets of tabs). Have i made a mistake here?

The field_icon field comes from a content type called Branch so i guess that would be why the variable wouldn't be available to the slider template, is this correct? Do i need to write a SQL query that links the current node to the appropriate Branch content type record to obtain the field_icon data?

Some feedback would be much appreciated.

 
 

Drupal is a registered trademark of Dries Buytaert.