Generate path by node type without Pathauto

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by mr.alinaki on September 3, 2009 at 8:39pm

Hi!

Is it possible to generate url aliases to nodes by their type without pathauto? I.e. topic/234, forum/456, where topic and forum are some content types? Maybe url_alter may help with that?

Comments

You could use nodeapi

Posted by markus_petrux on September 3, 2009 at 9:28pm

Implement $op 'insert' to create the alias, $op 'delete' to delete the alias, ...

http://api.drupal.org/api/function/hook_nodeapi/6

I use url_alter to implement

Posted by mr.alinaki on September 4, 2009 at 8:59am

I use url_alter to implement outbound an inbound on my site. But I don't understand, how I can get node type in that functions.

Read url_alter.api.php for details

Posted by markus_petrux on September 4, 2009 at 10:35am

...and then, you probably need to read the node to know the type it is.

Note that this function is used a lot, so you may want to optimize all you do here.

has to be asked...

Posted by greggles on September 4, 2009 at 1:02pm

Why not Pathauto?

What are you trying to do? custom_url_rewrite_* and url_alter and hook_menu_alter all may be important/useful toward the goal depending on what you are doing.

Im also wondering this

Posted by Macronomicus on April 17, 2010 at 10:48pm

Were importing and regularly updating 40,000+ nodes and have had to use drush amongst other things to make it perform well. One thing that was disappointing was the massive performance hit from using pathauto, it increased the time it took to import & update by at least 1000%, which is a no go for us.

Did you find some other solution, we have a few ideas but I am curious if you found a good option?

Cheers!

performance problems with pathauto

Posted by greggles on April 19, 2010 at 2:47pm

The performance problem is almost certainly related to tokens. If you figure out which tokens are causing the problems, I'd recommend removing their generation (even if by hacking...).

In Drupal 7 that's no longer a problem due to the on-demand generation of tokens.

Thanks for the tip .. ill see

Posted by Macronomicus on April 19, 2010 at 4:22pm

Thanks for the tip .. ill see if we can figure which tokens are dragging the most.

Thats nice to know about Drupal 7 ... suppose I should give that a whirl sooner than later. Im using pressflow drupal though so I'll be waiting for the 7.x release of that before we switch.

Cheers!

Paths

Group notifications

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

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