I want to reflect the menu-structure in the path.
I will soon write a module for this purpose (but only for nodes, i think). How should i call it?
DFG
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | pathauto_menu.sql | 134 bytes | dfg |
| #7 | pathauto_menu.inc | 2.15 KB | dfg |
| #6 | pathauto_node.inc.patch | 1.61 KB | dfg |
| #5 | pathauto.module_1.patch | 1.08 KB | dfg |
Comments
Comment #1
mikeryanRequest noted. If you come up with a patch, feel free to share it by attaching it to a reply here.
Reassigning issue to myself (the pathauto maintainer).
Comment #2
dfg commentedA first version of my menu feature is ready.
I made changes to pathauto.module and pathauto_node.inc
I also made a new file, pathauto_menu.inc, with the main functionality.
I would like to upload it to cvs, but my request isn't accepted until now :/
Comment #3
Uwe Hermann commentedYou shouldn't simply commit to CVS without asking the maintainer of the module. Please post a patch here for review first.
Comment #4
dfg commented(1) http://d-f-g.net/drupal/pathauto-menu/node-view.png
Here you can look at a path generated with my add-on.
(2) http://d-f-g.net/drupal/pathauto-menu/admin-menu.png
Here you can see the menu structure in the Admin Menu.
(3) http://d-f-g.net/drupal/pathauto-menu/phpmyadmin-menu.png
More information about the menu structure.
(4) http://d-f-g.net/drupal/pathauto-menu/phpmyadmin-pathauto_menu.png
When you look at the URL in (1) you can see "math" instead of "mathematics" and "numbers" instead of "number-theory". Thats because of the table in (4). This table is still experimental (there is no way to configure it via drupal, though we could add a way on several pages). This table won't be used if PATHAUTO_MENU_TABLE is not defined. Also the table has not to be present in the database. PATHAUTO_MENU_TABLE is NOT defined by default. See the first lines in pathauto_menu.inc
(5) http://d-f-g.net/drupal/pathauto-menu/phpmyadmin-url_alias.png
Now you understand the url aliases.
(6) http://d-f-g.net/drupal/pathauto-menu/pathauto-settings.png
There are three new things:
- the pattern box for nodes that are in the menu
- the placeholders [menu] and [menupath]
'pathauto_node_menu_pattern' has precedence over all node patterns, but will only apply if the given node is in the menu (and my add-on is active, of course). If pattern is empty or the node not in the menu, it will continue with the content type pattern and then with the default pattern.
(7) pathauto.module.patch and pathauto_node.inc.patch
These patches are stable: even when pathauto_menu.inc is not in path or wasn't included, pathauto will work as without these patches.
(8) pathauto_menu.inc
The core code for my add-on.
(8) pathauto_menu.sql
Optional table for using another title as url-part, and not the corresponding title in the menu table, e.g. "math" instead of "mathematics".
Comment #5
dfg commentedpathauto.module.patch
Comment #6
dfg commentedpathauto_node.inc.patch
Comment #7
dfg commentedpathauto_menu.inc
Comment #8
dfg commentedpathauto_menu.sql
Comment #9
mikeryanThanks for the patches - I'll review them when I have time. I'm afraid I'm flat out at the moment, between the day job, my primary site, and a contract I'm doing on the side, I only have time for bug fixes on my contributed modules.
Comment #10
jakeg commentedlooks like a great idea DFG. I'll check it out tomorrow perhaps.
Comment #11
mikeryanOK, I've done a basic implementation of this functionality, using the new pathauto_node hook (so no hacking of pathauto.module and pathauto_node.inc necessary). I will commit to cvs later today.
Comment #12
mikeryan