Right now we get to choose the pattern for new aliases.
Is it possible to add a field to set the path the aliases will point to?

E.g. Taxonomy module always sets "category/[cat-raw]" -> "taxonomy/term/{termid}".
Can we have an option change the "taxonomy/term/"?

I had to edit the hardcoded variables to do this. But because of that, I can't have it automated, so I have to edit the file (pathauto.inc, pathauto_taxonomy.inc) every time I want to update the aliases.

Comments

greggles’s picture

Version: 5.x-2.1 » 6.x-1.x-dev
Component: User interface » Code

Yes, I can see reasons for this. Pathauto doesn't currently support this and it would require a bit of "re-architecting" to get it there. I'm not currently working on new features and probably won't be for another 5 months. If someone else creates a patch for this and gets others to test it that would be great.

chrisirhc’s picture

Thanks for the quick response. At least I know what's going on yep.
In the meantime, I'll try to come up with something. :)
If I do come up with something workable, I'll post.

chrisirhc’s picture

Here's what I've come up with so far. Just some tweaking with the files.

Basically, bulkupdate code has to be updated per module, I've only updated the one in taxonomy module for my own use for now. My solution isn't module-friendly, in the sense that I replace the prefix in the $src variable in the pathauto_create_alias() function but that means less changes in the other files.

I'm new to development and submission so please don't be too harsh on me.
Attached are the files that were changed.
All the changes here are marked with //CUSTOMSRC .

chrisirhc’s picture

StatusFileSize
new17.73 KB

Updated and reposting.

greggles’s picture

Can you post this as a patch? http://drupal.org/patch/create

chrisirhc’s picture

Version: 6.x-1.x-dev » 5.x-2.1
Status: Active » Needs work
StatusFileSize
new4.28 KB

Here. Or should I work with the latest version?

chrisirhc’s picture

Version: 5.x-2.1 » 5.x-2.x-dev
StatusFileSize
new5 KB

Redid the patch with the dev version.

summit’s picture

Hi,
Hopefully complementary asking. otherwise sorry to disturb you.
Would it be possible to have an option to change the taxonomy/term not only like in the patch.
But also have the possibility to have a different change option related to the depth of the term.
this way with pathauto you can build a hierarchical solution, which would be great! again sorry to disturb if you want me to set a different issue for this.
Thanks a lot for considering this.
greetings,
Martijn

greggles’s picture

Version: 5.x-2.x-dev » 7.x-1.x-dev

This should be done in the 6.x-2.x where new features live.

Also, variables should have words separated by _ so $defaultsrcprefixes should be $default_src_prefixes

I'd also prefer not to have this adding an additional textbox to the UI for every single textbox. I think the best solution to this is to remove the UI for it and make these variables that can only be set in the settings.php or via something like the devel variable editor.

Thanks for your work on this.

dave reid’s picture

With entity_path() coming up in D7, I feel pretty strongly that this feature not be included in Pathauto.

dave reid’s picture

Status: Needs work » Closed (won't fix)

As per #10, marking as won't fix.