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)?
Comments
Comment #1
joshua.howell CreditAttribution: joshua.howell commentedAny suggestions please???
Comment #2
joshua.howell CreditAttribution: joshua.howell commentedSo 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.
Comment #3
kilrizzy CreditAttribution: kilrizzy commentedWould love to know how to do this as well
Comment #4
MULK CreditAttribution: MULK commentedOkay... I try to do the same but a little bit more complicated: with a special field in the Slider Content Type. I created a radio-button field you can choose the type of Tabs with: none, title of the node, numeric and Tab title (tab title take a specific field. created in my "slide panel" content).
I did the same as you did and I have the same problem as you: Tabs appear two times. Then, I modified the original module function, and added:
echo "hello world!"
at the end of the function (just before the last "}").
The text "hello world!" appear in my site !!!
This mean the tabs are generated two times: one with the original function, the second with the modified function in tenmplate.php.
This mean the function has a problem with the overriding in the template.php file, I think...
(sorry for my awfull english :)
Comment #5
MULK CreditAttribution: MULK commentedI found the problem!!!!!
in the original function, on the line #132, you have this
In my function (in template.php), I added $i in the empty key of the $vars['tabs'][] :
I'm not sure it's a good solution, but it work!
Comment #6
MULK CreditAttribution: MULK commentedkilrizzy -> If you want to have the file I created, no problem for me. But I'm working on them, they aren't finished.
Comment #7
MULK CreditAttribution: MULK commentedI found another (better) solution here: Overriding template_preprocess_slider() makes the tabs appear twice