image_gallery doesn't work well with pathauto.
First problem is that pathauto doesn't seem to be able to figure out the image gallery an image node is associated with. I would expect a pathauto description like "photos/[catpath]/[title]" to create a URL alias like "photos/image_gallery_name/img_1234.jpg", but instead it just gives "/photos/img_1234.jpg".
Second problem is creating aliases for the image galleries themselves. Since they are taxonomy terms, pathauto can create aliases for them, but the alias points to "taxonomy/term/x" instead of "image/tid/x". So, the alias doesn't display the image gallery but just a list of the image nodes.
Comments
Comment #1
decipheredI second this, this is a major issue for a page I'm currently working on as if my client adds or edits an Image Gallery it breaks the URL and the site.
Comment #2
decipheredChanged from Feature to Bug.
Comment #3
gregglesI just wanted to point to http://drupal.org/node/23829 as a partial motivation for why this is in image_gallery and not in pathauto's issue queue.
I also wanted to change this to feature (because it is one - lacking an aliased URL for a portion of a site doesn't "break" the site) and set the priority to "normal" because it is. If anyone really wants to see this get done and feels this is critical then I suggest you put a bounty on it.
Comment #4
drewish commentedmarked http://drupal.org/node/23830 as a duplicate (even though it predates this)
Comment #5
ellanylea commentedBeginning of a solution... create a new path pattern [imagepath]
1. I created galleries 'image/tid/3' and manually set their URL aliases to something like 'travel/zimbabwe/victoria_falls'.
2. Then I hacked pathauto_node.inc (I know I shouldn't, but this is experimental).
Added these lines to function node_pathauto($op):
Added these lines to function node_get_placeholders($node):
3. In pathauto, I set Pattern for all Image paths to: [imagepath]/[title]
Conclusion: all the image nodes 'node/23' are now 'travel/zimbabwe/victoria_falls/fly_high'
As always, feedback welcome :)
Comment #6
gregglesThis generally looks great, but...
1) Pathauto provides an API. It's up to other modules to implement that in their own files.
2) Can you provide these as a patch? http://drupal.org/patch
3) Shouldn't the module_exists check look for image_gallery?
Comment #7
ellanylea commented1) Thx for the recommendation. I still wonder, since both pathauto and image are contributed modules, does it matter which module is modified to suit the other? Does this mean the image module does not provide an API?
2) I've been trying to create a patch, but ending up with a file that looks like:
... which defies the whole point of creating a patch. I'm using WinXP and cygwin. What am I missing?
3) You're absolutely right, module_exists should check for image_gallery (not image)
Comment #8
ellanylea commentedlol, moments after I submitted the above reply, the patch generated correctly. I didn't change a thing... Gotta love Murphy. Anyhow, patch is now attached.
Comment #9
drewish commentedit's probably a problem with line endings, use dos2unix and unix2dos to convert back and forth (sometimes they're called u2d and d2u).
i think the correct way to do this is to offer it up to the token module. recent versions of pathauto use token to gather up all the little bits.
Comment #10
rogerpfaffis there a patch for 4.7.x too?
Comment #11
underpressure commentedI don't mean to complicate this and I know this should be added down the line but maybe while writing for this new feature you could take the following two ideas into consideration.
I'd like to see the follow two automated path ideas implimented for those of that have lots of images.
with image path enabled I'd like to see a setting for:
1. If no path is entered use term TITLE as path.
2. If no path is entered for photo use thumbnail title.
Comment #12
drewish commentedunderpressure, i think what you're really asking for is token support. you should create a new feature request for that and make note of what data you think should be provided as tokens.
Comment #13
guillaumeduveauThis now works very nice in 5.x-16 and possibly before, 5.x-1-dev and 5.x-2-dev, if you put photos/[catpath]/[title] in pathauto pattern for image node type your image nodes will be at this URL and also the image_gallery will print these URLs for the links to the image nodes. Of course you can do whatever you want with the pathauto pattern, this is just an example. Maybe you should try [catpath-raw] because pathauto wants -raw.
It works so image deals correctly with pathauto and token.
OK this doesn't work yet.
It doesn't work so image_gallery doesn't deal correctly with pathauto and token.
I don't have the skills yet to fix this. All I know is that the problem is in image_gallery and not in image. Here's a feature request for token (or pathauto) support in image_gallery that I filled.
Comment #14
sunSorry, 5.x-1.x won't see any new features. Feel free to re-open this issue if it still applies to 6.x.