RSS vs. ImageBlock for Wordpress Sidebar Images
ginakra
Joined: 2003-03-13
Posts: 9 |
Posted: Wed, 2007-01-24 20:32 |
Hi all, I have Gallery 2.1.2 and I'm confused on how to display images from my Gallery in my Wordpress sidebar. I've been looking at ImageBlocks, but I can't figure out how to target a specific album. Should I use RSS instead? I have these albums: Album: Current Projects Album: Future Projects 1. A random image from the Completed Projects and all the subalbums underneath as a whole. I've tried: but it shows a random image from ALL the albums and subalbums. How do I target specific albums? Or, should I use RSS for what I want? Thanks for any help. I just installed Gallery yesterday, and have done a lot of reading, but I'm kind of stuck here. Gina |
|
Posts: 9
Well, it figures after working on it all day yesterday and most of the day today, I find the answer myself not long after I post, lol. In order to help someone else who has the same question, here's how I did what I wanted.
You can target specific albums in an external imageblock. All you have to do is find the itemId of the album you want to pull images from. You find the itemId by clicking on the album you are going to target and looking at the url. You should see itemId=xx in the url. If you don't, try turning off URL Rewrite (Admin-->URL Rewrite). Just uncheck anything that is acitvated (write them down first so you can reactivate later) and save the changes, then reload your gallery.
Once you have the itemId, then you can just plug it into the external imageblock code and away you go. For example, I wanted to pull:
2. The most recent image from Completed Projects, subalbum "2007" only. The itemID of "2007" is "60" so the code would be:
<?php @readfile('http://www.site.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_itemId=60&g2_show=title'); ?>
3. A random image from Future Projects. The itemId of "Future projects" album is "61", so the code is:
<?php @readfile('http://www.site.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_itemId=61&g2_show=title'); ?>
(obviously, make sure your site url path is correct, replacing your gallery url with the one the imageblock area says you should). I found the answer during a web search. Between this Drupal page http://drupal.org/node/53087, and this forum page http://gallery.menalto.com/node/53803, I got it working.
Hope this helps someone else!
Gina
Posts: 22
Gina, thanks for coming back to say how to solve the problem! This is exactly what I was looking for, but unlike you, I'd never have figured it out on my own. (If and) when I have it working, I'll come back to report success (or failure).
Posts: 22
Nope, my hosting service doesn't allow readfile to work for security reasons, so I had to go to this method: How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled
Briefly, that requires the following code:
with one's own URL inserted. Set show=none at the end of the long line if you don't want the titles appearing. The images appear at whatever size the thumbnail is set at in Gallery2. I wanted to control thumbnail size, so I ended up using the WPG2 plugin, after all.
Posts: 8339
would this help?
-s
FlashYourWeb and Your Gallery