I wanted to post my ideas and what I thought would be a good roadmap for Pathauto as we're getting closer to a Drupal 7 release and what could be a big effort to have Pathauto in core for Drupal 8. I'd love to hear your feedback on these ideas!
- First, split our current admin page into two separate pages: Patterns and Settings. This the first step that let's us pave the way for everything else.
Issue link: http://drupal.org/node/713632
- Re-use core's concepts of entities that have paths. There's a lot of code that can be reduced and generalized to support D7's entities. We even have things like hook_entity_insert and hook_entity_update that could replace a lot of the node/user code.
- Stop supporting any of the 'sub-pages' of entites we already help alias. Support pages like user/x/contact and user/x/track aliases when we already provide support for user/x paths makes the module more complex. To simplify things it should only support paths of D7's entities (nodes, user accounts, taxonomy terms, etc.). People can that use modules like Sub-path URL aliases to support the infinite number of sub-paths that users might encounter.
Issue link: http://drupal.org/node/717386
- Store our patterns in the database instead of variables. This allows easier retrieval and to find the right pattern/fallback. Plus we could enable fun things like making patterns available for exporting, or for Features. And it also enables us to accomplish the next task:
- Re-architect our concept of alias 'alterations'. Instead of having so many options for altering aliases (lowercase, separator, strings to remove, punctuation, etc.), what if we re-thought each of these things as an 'alteration', much like ImageAPI in core has 'transformations' that can be applied to an image. And think of each Pathauto pattern as an 'Image style'. For Pathauto, we'd start out with a few different types of 'alterations':
- Change case
- Find/replace words/strings
- Find/replace characters.
By default we'd have the following alterations enabled as well:
- Change case (lowercase)
- Find/replace words (a/an/as/at/etc => '')
- Find/replace characters (spaces + punctuation => '-')
- Trim length
- Trim component length
Like Image API in core, there are default settings/alterations, and eventually each pattern could override the default alterations to add or remove specific alterations. And users can re-order the weight of alterations as well via drag & drop. Other modules (like Transliteration) could provide their own alias alterations and make them available to Pathauto via a hook.
Issue link: http://drupal.org/node/686234
- Along with storing the patterns in the database, it would completely revamp the UI for how we manage URL alias patterns. Instead of overloading the user with a big long page with tons of fieldsets and every possible node type, language, etc combination possible, we go for a "progressive disclosure" approach (see screenshots below). This also means its easier to add a better 'available tokens' interface since we know exactly the entity that the pattern will be used for.
Issue link: http://drupal.org/node/273104
- And of course, add tests, tests and more tests.
Screenshots! Everyone loves screenshots!
The following screenshots are basic mockups of where I envision Pathauto's UI heading: