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.

Comments

drewish’s picture

Version: 5.x-1.x-dev » 4.6.x-1.x-dev

the attached patch is for 4.6 but i wouldn't mind seeing something similar for 4.7...

drewish’s picture

Status: Active » Closed (won't fix)

unless this is updated for a more recent version i'm not going to commit it.

ShavenYak’s picture

Version: 4.6.x-1.x-dev » 5.x-0.3
Status: Closed (won't fix) » Needs review
StatusFileSize
new1.11 KB

I'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.

drewish’s picture

Title: Pathauto placeholders » Token module (Pathauto 5.x-2.x) support
Version: 5.x-0.3 » 5.x-2.x-dev

The attached patch implements the token module's hooks. This provides support for pathauto 5.x-2.x.

drewish’s picture

StatusFileSize
new3.38 KB

here's the patch

drewish’s picture

Status: Needs review » Fixed

committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)