Is there a way to programmatically add an array of images from a particular file path? I want to add all the images from one folder in my drupal site and add fancybox styling to them. Can this be done? I've tried looking on drupal.org with no success.
-
Do you just want to display the images on the node page or do you actually want them to be attached to the node (so they would show up on the node edit page as well where you can manage them)?– MadisCommented May 10, 2012 at 20:49
-
Maybe you are looking for something like drupal.stackexchange.com/questions/11413/…– greg_1_andersonCommented May 10, 2012 at 23:22
-
Hello, Dooshta. I would prefer the latter. I would like to be able to edit them in a table or divs. That way I can have total control of what is being displayed, dynamically with the content and style wise with the css. thanks.– James30Commented May 10, 2012 at 23:52
1 Answer
If by 'programmatically' you mean using PHP, then there seem to be two good options.
Create a template file, include the fancybox library if not already loaded, load the file path/names from your image directory into an array, tweak the array as needed, and call fancybox with the paths in your array.
Create a custom module that does essentially the same thing, but here you can also add an admin view to manage the images, set custom permissions, etc.