Hi all,
I was wondering if it is at all possible to get even nicer URL's in Zenphoto, as I am still not too keen on the way zenphoto is rewriting the urls at the moment.
The best thing for me would be to use the title of the image in the url. An example:
In stead of
http://www.thegirlinthecafe.com/photo2/new york/newyork005.jpg.phpI would love to have
http://www.thegirlinthecafe.com/photo2/new-york/123-times-square(where 123 is the id of the image in the database, if at all needed)
I have this working on my photoblog (which is running pixelpost):
http://www.thegirlinthecafe.com/photoblog/160-london-marathonand it works like a charm, google seems to love url's like that.
Has anybody tried this? Is this at all possible?
Thanks in advance for any help,
Ingrid
Comments
Unfortunately it's not easily changed (at all) - the unique identifier to find the photo requested is the actual filename, and the only way to get that is from the URL, so it must contain the filename. That's just how ZP works, it's filesystem-based. The titles are rather stored in the database as metadata, which you can't use to get a photo and doesn't need to be unique.
In future versions I'm planning on basing the framework on the database while keeping filesystem synced, instead of the other way around. That should allow more reference options in the URL. I'll make sure to keep that in mind in development..... if I ever have free time again after this startup gets off the ground.... :-(
Thanks for your answer, and I really appreciate your hard work.
I am just too lazy to rename all my pictures so they have proper titles, that's why titles in my case would make more sense in the url than the filename. But it has to do for now I guess
Does Zenphoto now support nicer URLs ? It would be nice to have URLs like "/album/qName-of-the-photo" instead of "/abum/IMG4254.JPG".
Without changing the way the framework is designed, maybe you can just add a field to rename the photo ? Or, better, automagically transform the title into a qualified name (space replaced by -, etc...), and add a checkbox under the title field like "Rename the file for 'qName-of-the-photo' ?".
Thanks !
I've taken this request on, and will get it worked out when I can. I might not get it done until after my current semester, though. My senior project comes first. (Yay wavelets!)
DirkSohler: But the difference to zenphoto is that wordpress is not file system based.
sbillard: This is not really something that belongs to l18n, it's a general topic.
Jsumners: No hurry, I have already sort of a function, that can do things like that, that needs a little refining.
1/ you have to set the title twice : first in the filename, second in the title field when you post the photo
2/ even if I rename a "IMG1234.JPG" into "my-first-day-in-Berlin.jpg" for instance, there is still this ".jpg" that has no reason to be in the URL (cf http://www.w3.org/Provider/Style/URI). I want to remove this extension because with an album photo, you don't just give access to a photo file, you give access to a whole photo+title+comments+category+tags resource, which is more than a simple file, and so can't have any extension.
That's why I suggested :
1/ to have a checkbox in the form to add a photo that, if checked, generate a qualified name from the title (the way Wordpress does, cf DirkSohler comment), and rename the file this way. For instance, if I put "My first day in Berlin" as title, the file IMG1234.JPG I sent is renamed on the server as my-first-day-in-berlin.jpg
2/ find a way (maybe with Apache content negociation or mod_rewrite) to use the URL /my-first-day-in-berlin, without the ".jpg"
This way, Zenphoto would have very nice URLs, without changing the whole design (i.e. zp would still be FS based, and not DB based as Wp or other script can be).
It would be great, I can't find a great photo album manager with nice URL...
Thanks again for your work !
There is an option to add a image suffix, so you could use, say "view" and your file would show as "my-first-day-in-Berlin.jpg/view"
If you put a title in your EXIF/IPTC data, it will be used as the zp title. Omitting the suffix on the filename that is on the server will cause all sorts of problems for zenphoto. That's the key it uses, for instance, to recognize images vs other files.
Nothing is needed in mod_rewrite to omit the suffix. The problem is how to determin what the suffix should be. No suffix: then it is an album request. JPEG, JPG, GIF, PNG? FLV, 3GP, MOV?
It would not be too hard for you to modify a theme to omit the suffix. But then every request will go to your albums.php file. It could then decide what to do.
BTW, I am wondering how much of a problem this really is. Why are you looking at the URL anyway, the images should be the attraction of your album.
You can modify the function zp_load_request() so that it will treat the last name in the list as the image name if you wish. Just add the .jpg suffix to what rewrite_get_album_image() returns as the image filename.
I will try to create a maintenable hack for my problem.
Thanks
the images are all going in with the same title format and displaying as follows
Jen Akenyemi - Flowers Traditional.jpg
Gerry Carnelly - Purple Octopus
Gerry Carnelly - Siamese Fighting Fish
http://www.tattoo.tv/gallery/colour/Jen-Akenyemi-Flowers-Traditional.jpg
http://www.tattoo.tv/gallery/colour/Gerry+Carnelly+-+Purple+Octopus.jpg
http://www.tattoo.tv/gallery/artists/Gerry Carnelly (Octopus Tattoo)/Gerry+Carnelly+-+Siamese+Fighting+Fish.jpg
Thank you
Steve