I wanted to use pathauto to generate aliases for audionodes by album name. I could have set up a taxonomy term for each album, but that seemed silly since the information was already in the ID3. So, after a bit of hacking around, I implemented the pathauto_node hook myself.
I've created pathauto placeholders for track number, title, album, artist, year, and genre. I'm only using album, but I did test that all of them at least work. One thing that someone might want to fix - it really should add a leading zero to the track number if it's only one digit.
I'm not that knowledgeable about PHP, so this code might not be bulletproof or efficient. I also don't have shell access to run diff on my web server, so this is just a cut-and-paste of the function itself and not a patch. But at least it'll give someone a starting point.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | audio_token_41277.patch | 3.38 KB | drewish |
| #3 | audio_pathauto_node_5.TXT | 1.11 KB | ShavenYak |
| audio_pathauto_node.TXT | 1.86 KB | ShavenYak |
Comments
Comment #1
drewish commentedthe attached patch is for 4.6 but i wouldn't mind seeing something similar for 4.7...
Comment #2
drewish commentedunless this is updated for a more recent version i'm not going to commit it.
Comment #3
ShavenYak commentedI'm updating my band's site to Drupal 5.1 (finally), so I've redone my changes for audio.module 5.x-0.3 now. I've also updated it to create placeholders for any tag that is in the list of allowed tags. Here it is, for what it's worth.
Comment #4
drewish commentedThe attached patch implements the token module's hooks. This provides support for pathauto 5.x-2.x.
Comment #5
drewish commentedhere's the patch
Comment #6
drewish commentedcommitted to HEAD.
Comment #7
(not verified) commented