Sensible Links That Would Survive Re-Sizes?

rablake

Joined: 2006-12-19
Posts: 2
Posted: Tue, 2006-12-19 13:03

I have URL Re-write set up and you can have sensible format like http://mysite.com/gallery2/main.php/SomeAlbum/SomePicture.JPG.html which is great, but how in the heck do you accomplish a similar sensible PERMANENT link to the image itself? Using the download item rewrite I get http://mysite.com/gallery2/main.php/d/ItemID-SerialNumber/SomePicture.JPG instead. Why change the format around? Why use ItemID, which is a value that changes on resizes / thumb regeneration? How can I get http://mysite.com/gallery2/main.php/SomeAlbum/SomePicture.JPG.html&SerialNumber=x to simply tell it what album, picture, and level of resize I want it to show? This other combination already tell it which image to work with in the first place, I just need to be able to specify which level of resize I want.

The reason for this specific need is that I have a website where I write about my travels and such, and when I link in to an image I want to just grab that from Gallery2, which works fine but I can't count on the links staying if I decide to add a new image size, for example. If you're just looking at the Gallery itself it's no problem but I need to be able to link an image and have it stay there without having to check for broken links and hoping to remember which image I'd put at that point in the story. Can this be done?

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Wed, 2006-12-20 03:00

- the serial number doesn't matter. g2 ignores the serial number in case it has changed. (that is: the serial number is used in URLs to prevent client-side caching if the image has changed)
- the itemId (entityId) changes in G2.1 if you rebuild thumbnails / resized images / when you change the resized image settings.

In G2.2, we try to no longer change the entityId if possible.

If you need a URL that works no matter whether the image is moved or whatever, use the permalink module.

Login or register to post comments
rablake

Joined: 2006-12-19
Posts: 2
Posted: Wed, 2006-12-20 07:43

Ah, gotcha. I had noticed the SerialNumber being different as I loaded the various images but it sure looked like it associated with the order of resize pretty well.

The problem with permalinks is that it seems to need to be manually set and I have some 2000 items currently, and doesn't work well with the concept of subalbums for me. I use Year Month TripDestination and there may or may not be subalbums depending on how many shots I took for each place we were. I'd like a hierarchical permalink set for each image a la the Name field for the photo itself. It seems that we HAVE that information, just can't use it effectively. Even so, I need the ability to link the actual image and not the Gallery page itself, which is why I wanted something like http://mysite.com/gallery2/main.php/SomeAlbum/PossibleSubalbum/SomePicture.JPG.html&SerialNumber=x (I just updated this)where the SerialNumber (or what have you) corresponded to the size of the image - 0 thumbnail, 1 smallest size, 2 next biggest size...I suppose for simplicity, thumbs could be t and the original image o or something. That way it wouldn't be a problem for albums having different levels of resize available.

Can you give more detail on what might change the entityId in G2.2 and what would no longer require it? Do we have any idea if 2.2 is days / weeks / months away? Not necessarily specific, but more helpful than August 2006 or "when it's done."

Login or register to post comments