By steff2009 on
Hi,
I'm using Image module for image galleries and would like to create a block that displays random images from a specific gallery of my choice, rather than from any existing gallery (like the default random image block already does).
I found this php snippet at http://drupal.org/node/53987 but can't figure out how to make it work and no replies were given by its creator.
Does anybody have an idea on how I could achieve my purpose or how to configure the above php snippet correctly?
Thank you very much for your support, regards.
Comments
Views can be configured to do
Views can be configured to do this.
http://drupal.org/project/views
Do you mean using Image module...
..combined with Views or should I abandon Image to use Views only?
Views works with all
Views works with all nodes/fields, so it's up to you.
recipe
This post pretty much walks you through it:
http://thedrupalblog.com/creating-rotating-image-block-using-views-and-i...
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Thank you guys..
You seem much more expert than me, would you maybe also tell me how to modify the php snippet below to build a block using the simple image gallery module?
I only entered the image gallery name but the block doesn't appear at all. What else do I need to specify?
Thanks again in advance.
Views
I would never do it this way. I don't know php well enough AND the tools for this are built into Views.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
But Views is such a complicated module!
I tried installing and configuring it 10 times today and it always messes up my galleries! Don't want to use it!
I only need a php snippet to build a block, that's all. Pleeeeeease! :-(
okay
Views is a little complicated. In my case I didn't want to have to hunt around for PHP snippets and then beg people to re-write them for me. So I hunkered down, watched a few tutorial videos, and learned to use it.
Looks like you have chosen a different path. Good luck.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Sarcasm doesn't help
There maybe multiple reasons why I'm not able to study Views at the moment, included the fact that I'm a webmaster managing dozens of websites for my clients on multiple installations and I need to do things quickly.
Drupal's forum is a place for support requests and knowledge sharing, and not for nerds who maybe would know how to do things -- but do not want to tell others and only boast about their personal achievements.
_
Sorry... but you missed mcfilms' point entirely. He wasn't 'boasting' about anything. He was pointing out that if you opt to not use the 'standard' tools for a particular function, then it's on you to work out the details of the alternative. I venture to say probably 99.99% of the folks that help out in the forums use views for what you describe (and therefore don't know the exact code for what you're asking).
You then go on to say you're too busy to learn views but yet expect others to take time away from their busy schedules to figure out your consciously choosen more difficult solution for you-- one which they wouldn't even bother to do for themselves.
Can you see how that comes across?
There's no reason views should mess up your galleries-- a block view will only affect the block it creates. Nothing else. And selecting a random image is as simple as using the "global: random" sort option.
And your argument about having to do things the 'fast' way doesn't hold up. There's no way constantly having to post around for specific php help, which may or may not be usable in the future, is going to be faster than spending a little time upfront learning views which can then benefit all your drupal sites. Moreover, you're much more likely to get fast useful assistance in the forums for views questions than php questions.
Yep
I see where this is going and I'll just have to excuse myself from the conversation.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com