tag combinations similarly to "term/1,2" and "term/1+2" don't work with pathauto?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by vkha on June 15, 2008 at 5:08pm

Hi all,

if this issue is correctly understood, then tag combination is not available?

Is there any chance to get operators "+" and "," working under pathauto like they do in plain taxonomy module?

thanks!

Comments

I'm pretty sure you could

Posted by catch on June 15, 2008 at 9:05pm

I'm pretty sure you could add them manually as path aliases for different combinations. Having them added automatically seems like a recipe for disaster to me though. However, I've got a feeling that views 2 will allow for something similar to this without the many, many path aliases that would be required otherwise.

hm, but why disaster? it

Posted by vkha on June 15, 2008 at 9:54pm

hm, but why disaster? it works for the "plain" taxonomy module, so I thought why it shouldn't for the pathauto?..

http://dooblet.com -- find alternatives to anything

Plain taxonomy module does

Posted by catch on June 15, 2008 at 11:21pm

Plain taxonomy module does 1+2 etc. via url arguments. pathauto aliases url arguments to arbitrary urls.

So if I hav+e 3 terms.

currently handled by pathauto aliases:
taxonomy/term/1
taxonomy/term/2
taxonomy/term/3
combinations you'd have to add to duplicate core taxonomy module functionality:
taxonomy/term/1,2
taxonomy/term/1,2,3
taxonomy/term/1,3
taxonomy/term/2,3
taxonomy/term/1+2
taxonomy/term/1+2+3
taxonomy/term/1+3
taxonomy/term/2+3

Now multiply those combinations by 2-3,000 (not that much for a freetagging vocabulary).

"combinations you'd have to

Posted by vkha on June 16, 2008 at 6:36am

"combinations you'd have to add to duplicate core taxonomy module functionality:"

why necessarily add? I thought of simple solution:

  1. Similarly to taxonomy's approach regular expression takes the URL extracts the arguments of the operators "+" and "," on fly (or even a usual "split" function can be used).

  2. extracted arguments are resolved into the term IDs with taxonomy_get_term_by_name (it provides even the terms themselves not just IDs)

  3. Term IDs are passed to the same taxonomy (not pathauto!) engine that generates the result for the strings like "taxonomy/term/1+2+3". Namely to taxonomy_select_nodes. If we'd like to avoid 2nd time db querying than we might use the term array from step 2.

That's all.

Why not?

http://dooblet.com -- find alternatives to anything

great - simple

Posted by greggles on June 18, 2008 at 1:11pm

patch? great joke :)

Posted by vkha on June 18, 2008 at 7:49pm

i've written NO code in PHP yet -- so, no idea how much sarcasm in your reply :)

http://dooblet.com -- find alternatives. alternatives to anything.

http://dooblet.com -- find alternatives to anything

incorrect mental model of how path aliases work

Posted by greggles on June 18, 2008 at 10:04pm

well, your idea of how to solve this is based on a bad "mental model" of how the path alias system works. That's why I said that I was looking forward to the patch - you said it was simple, right ;) In fact it is not simple. :(

As catch has pointed out below, there is a solution to this but, frankly, it's way more work than I'm interested in doing and has little to do with the way that Pathauto currently works...

--
Open Prediction Markets | Drupal Dashboard

What are you actually trying

Posted by catch on June 18, 2008 at 9:38pm

What are you actually trying to do?

For taxonomy/term/1+2 to category/1+2 you ought to be able to use http://api.drupal.org/api/function/custom_url_rewrite/5

Paths

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /