Does pathauto work with relativity? I see on drupal.org that a discussion happened a year ago, but I cannot see if it resulted in anything.

Use case: You have a parent and the child gets the url: www.yourhomepage/
/.
The problem is if you have several parents. A config option where you could choose parent would solve this.

Does anyone know if this works?

CommentFileSizeAuthor
#7 token_3.patch7.89 KBowahab

Comments

greggles’s picture

Sorry - I don't use relativity.

In Pathauto5.x-2 the token module is used to create patterns, so if it implements the token hooks then Pathauto should be able to do something with it.

greggles’s picture

I realize now that was a little obtuse - when I said I don't use it I just mean that I have no idea how/if/where it could or would work with pathauto.

greggles’s picture

Title: Pathauto with relativity? » Pathauto with relativity
Project: Pathauto » Node Relativity
Version: 5.x-2.x-dev » master
Category: support » feature

Also, if relativity doesn't work with pathauto then that should be lodged as a feature request for relativity - not with Pathauto.

To the maintainer of relativity - there is an API.txt in the pathauto module and if you have questions on how to implement it I can answer them.

storbaek’s picture

Project: Node Relativity » Pathauto
Version: master » 5.x-2.x-dev
Category: feature » support

Thanks for your input so far Greggles. Another person fixed the pathauto / relativity issue by hacking the pathauto module, which I'm trying to do as well - but unsuccessfully so far. See http://drupal.org/node/151739. A search on drupal.org reveals that several persons are looking for sweet link between pathauto and relativity, as the two modules would form a perfect match together. I just hope that addon will be added to the correct module - being relativity or pathauto :-) Thanks again.

greggles’s picture

Title: Pathauto with relativity » Implenet _Pathauto or _token hooks in Node Relativity
Project: Pathauto » Node Relativity
Category: support » feature

Indeed, the proper place to implement either (or both) the _pathauto and _token hooks is in the Node Relativity module.

Please don't change this back to the Pathauto queue.

Also, this is a feature request for that module. There is no "support" needed in this situation. The work to be done is clear to anyone who has taken the time to read the API documentation included in both of the modules.

owahab’s picture

Assigned: Unassigned » owahab

http://drupal.org/node/152287 has some ideas about the same issue.
Just to prevent work duplicates, I will start with token support in relativity.

owahab’s picture

Status: Active » Needs review
StatusFileSize
new7.89 KB

I thought about implementing simple token support and then enhance it.

owahab’s picture

According to greggles: pathauto will be able to "talk" to token module, I see no use to integrate with pathauto and token.
Token support will be enough.

owahab’s picture

Committed to 2.x-dev.
If enough people said it's OK then the next release of 2.x will witness this feature.

darius’s picture

Title: Implenet _Pathauto or _token hooks in Node Relativity » Implement _token hooks in Node Relativity

Thanks, Omar. Question: do we need these settings of values to empty?

+      $values['parent-nid']            = ''; 
+      $values['parent-title']          = ''; 
+      $values['parent-type']           = ''; 
+      $values['parent-type-name']      = ''; 
+      $values['parent-author-uid']     = ''; 
+      $values['parent-author-name']    = ''; 
+      $values['parent-yyyy']           = ''; 
+      $values['parent-yy']             = ''; 
+      $values['parent-month']          = ''; 
+      $values['parent-mon']            = ''; 
+      $values['parent-mm']             = ''; 
+      $values['parent-m']              = ''; 
+      $values['parent-ww']             = ''; 
+      $values['parent-date']           = ''; 
+      $values['parent-day']            = ''; 
+      $values['parent-ddd']            = ''; 
+      $values['parent-dd']             = ''; 
+      $values['parent-d']              = ''; 
+      $values['parent-mod-yyyy']       = ''; 
+      $values['parent-mod-yy']         = ''; 
+      $values['parent-mod-month']      = ''; 
+      $values['parent-mod-mon']        = ''; 
+      $values['parent-mod-mm']         = ''; 
+      $values['parent-mod-m']          = ''; 
+      $values['parent-mod-ww']         = ''; 
+      $values['parent-mod-date']       = ''; 
+      $values['parent-mod-day']        = ''; 
+      $values['parent-mod-ddd']        = ''; 
+      $values['parent-mod-dd']         = ''; 
+      $values['parent-mod-d']          = ''; 
+      $values['parent-menu']         = '';
+      $values['parent-menupath']     = '';

If yes, then can't you write it as loop through all the keys (from relativity_token_list, for example). This repeats a lot of lines, and relativity.module is already too long and hard to understand...

owahab’s picture

You caught me. :)
I think we need to set the values to empty and yes it's a good idea to write more compact code.
I was trying in my patch to mimic token_node.inc which is working in a similar way and with a similar code structure. ;)

storbaek’s picture

+1. I would welcome the update to the 2.x release.

storbaek’s picture

I would like to test the dev version, but does anyone know what I should write in pathauto (which uses the token module) to get the child name following the parent url?

Use case: Adding parent (e.g. parent51) www.yourhomepage.com/parent51 and adding a child (child 52) for this parent would give www.yourhomepage.com/parent51/child52.

owahab’s picture

Unfortunately, pathauto will not support tokens untill 2.x version is out (which is currently under development).
So right now we will be able only to support token module.

owahab’s picture

Grrr, let's clarify my last post:
Greggles informed me that only pathauto 2.x will be able to read tokens from token module.
And as you see, pathauto is still in 1.x, thus currently there won't be support for pathauto module in relativity.
(Hope it's clear now)

greggles’s picture

Well, kinda...

Pathauto 5.x-2 is in development and is available for testing: http://drupal.org/node/129349

In my tests it works reasonable well, but there are certainly some known bugs (even critical ones).

storbaek’s picture

Pathauto: 5.x-2.x-dev
Token: 5.x-1.x-dev
Relativity: 5.x-2.x-dev

It should be working, but I do not seem to have pathauto and token work with node relativity - as it should. I'm using [parent-title]/[title] in pathauto, but it only adds the title of the child? Has anyone else tested this with success?!

owahab’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)