Hello,
I'm a Drupal newbie struggling with my first custom theme.
Basically, I've created a rotating image display on my front page with jQuery, and I want the images to be pulled from a View. I want the
tags to be dynamic with paths provided by the View.
I think I need to create a preprocess function naming variables that will then be the image paths for each of my
s. I've installed the Devel module and have used it to target the "candidate function name" and have drilled down to find the "Function Arguments" that define the variables that I want printed in my
tag html. But I don't know how to write the function or pull the argument out of its array. I've spent hours researching it and trying to write it, but I'm hoping this will be an easy win for someone who's more fluent in php than I.
Here's what Devel module provides:
Function called: theme_filefield_formatter_path_plain()
Candidate function names:
mytheme_filefield_formatter_path_plain()<
etc. (two other less specific function-name suggestions)
Function Arguments:
... (Array, 1 element)
element (Array, 7 elements)
#item (Array, 12 elements)
data (Array, 3 elements)
filename (String, 14 characters) dino_clock.jpg
filepath(String, 43 characters) sites/default/files/images/
I want to take the filename and filepath for this image (and 4 others) and dynamically place them in my template. Any help writing the preprocess function and instructions on how to properly call it would be GREATLY appreciated!
Thanks!
Comments
Have you considered just
Have you considered just using the Views Rotator module?
http://drupal.org/project/views_rotator
Solution
Thanks for any and all comments. I believe I've found a solution by changing my View arguments. No need to get into messy preprocess functions... yet.
Thanks.