I have Category 5.x-1.1 installed and Category pathauto enabled. I also have Pathauto 5.x-2.0 installed and in most cases pathauto seems to work quite nicely. However, when trying to have paths generated to my categories and containers I am not able to find the placeholders [container], [categorypath] and so on in the form of Pathauto.
I've been trying to reverse engineer how these modules work together and it does not make sense to me.
category_pathauto implements a hook called hook_pathauto_node()
This hook is, as far as I'm able to tell, NEVER CALLED. In my humble opinion this (or a similar hook) should provide pathauto with the placeholders of the Category module.
Pathauto does call hooks for retrieving placeholders, but this is done throug calling something like hook_pathauto() with the 'settings' parameter - not the 'placeholders' parameter and a node object that hook_pathauto_node() appears to expect.
The options I do have includes using taxonomy pathauto placeholders that are implemented in a taxonomy_pathauto() hook. Using these placeholders I get aliases genereated pointing to real paths (like: 'node/' and 'taxonomy/term/0/feed') that does not work at all.
I have checked Pathauto versions 5.x-1.2 and 5.x-1.1 and they both call hook_pathauto('settings') and not hook_pathauto_node('placeholders', $node).
Can anyone shed some light on this for me?
/Sten
Comments
Comment #1
stenjo commentedNo one able to comment on this?
Basically category_pathauto does not work in my installation at all.
I realize that I probably have to fix this myself, but I'm reluctant to do that unless I'm sure I've understood this the right way. Right now, how it seems to me, is that the category_pathauto module does not seem to be written or updated to fit the latest Pathauto versions.
A short comment from any of you guys/girls that this in deed seems to be the case, would make me more confident that a small rewrite of the category_pathauto module is in place.
I will, of course provide a patch that will make the module work as soon as the module is tested and ready.
/Sten
Comment #2
liquidcms commentedi am trying to sort out issues with latest 5.x dev version of category modules; but it did seem to do pathauto parts correctly when i set it up earlier today.
I originally was looking for some way to turn off the "category"section of pathauto admin since that is what i thought cat_pa was doing. But i think it is actually adding tokens to the "node" section for pathauto - which is of course where i wanted it to be since i use cat_transform to convert cck types into categories and it is those "nodes" that i want cat_pa to help with url aliases for.
Sorry i can't give you much for examples since i have wiped my original set up as i try to sort out when dev commits busted the multiple parenting of categories.
Comment #3
stenjo commentedHow exactly is it ment to work? My understanding is that category_pathauto adds placeholders to the path generation string so that when creating containers and categories the pathauto module is able to create paths based on the category name and the container name amongst other things.
this is definitively not the case in my installation referred to above. It seems that pathauto has a taxonomy part that provides some placeholders. These are available when setting up pathauto paths, but they certainly do not work in my case.
Looking through the category_pathauto code it seems that this module is supposed to provide me with the following placeholders:
In the pathauto settings page (admin/settings/pathauto) I am not able to find these placeholders anywhere, neither in the Category path settings (that seems to be implemented in the pahtauto module in hook pathauto_token_list()) nor in the Node path settings.
The category_pathauto does not seem to implement the hook_token_list() that appears to define all the placeholders in other modules.
When using what I have I set up the path pattern '[termpath-raw]/[term-raw]' for both containers and categories in the Node path settings section in Pathauto. This leaves me with no path generated for terms and categories.
I just can't figure this out!
/Sten
Comment #4
liquidcms commentedI think safe to say there are a few issues with cat_pathauto.
I do get these tokens listed under Categories section in pathauto admin.
I have my Container settings for pathauto as: [catpath-raw] and it seem like this was almost working; but:
my structure
Product Cats [cont]
Office
- Juicers
Electronics
- Juicers (same node as under Office, but it has both Office and Electronics as parents)
- TVs
path for juicers is: Office/Electronics/Juicers - not exactly what i would have wanted; but i can see why it might be right for someone
path for TVs when i first add the node is /tvs (which is wrong)
when i edit and re-submit it changes to electronics/tvs (which is correct)
I'll do some tests with Node settings for pathauto and likely just not use cat_pa for now (or possibly eventually recode it so that it works correctly)