How to configure pathauto in Drupal 7 for a forum

greg's picture

He has: 1,581 posts

Joined: Nov 2005

EDIT - Resolved in a comment later in this post

I have the latest pathauto and token modules installed, but can't get it configured.

I want the same as this site, where containers, forums and posts are title names, not nodes and Ids
eg
"designing-your-website" container is:
http://www.webmaster-forums.net/designing-your-website

And "webmasters-corner" forum itself:
http://www.webmaster-forums.net/designing-your-website/webmasters-corner

And the post title "what-are-your-favourite-web-development-add-ons-firefox" is:
http://www.webmaster-forums.net/webmasters-corner/what-are-your-favourit...

I've played around with "Pattern for all Forum topic paths" and "Pattern for forums and forum containers" but I just get nodes, nothing at all (just the post title), or for containers I get "edit-container-2" and forums returns "edit-forum-0".

What are the patterns I need please?

Cheers

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

What do you have for the path pattern now? Since this site is only forums, we have set the path alias for all nodes, like this:

[term-raw]/[title-raw]

Forums are taxonomy terms.

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Yeah but those ones no longer work in Druapl 7 Sad

I only have a forum setup too
I'm getting there, however.

Pattern for forums and forum containers :
[term:vocabulary]/[term:name]

This is now working for containers and forums, just need to get the posts to show forum and post, not just post as it currently is.

EDIT:
Also, it seems the pathauto wasn't rebuilding when it should have been. I had it set to delete old aliases and create new (the forum is new & not live), yet now I've gone and manually deleted all aliases and set the "URL Aliases" to regenerate them all, it generated every one and some of the issues I was having are now resolved.

greg's picture

He has: 1,581 posts

Joined: Nov 2005

UPDATE:
So after many more hours of reading and playing around, I now have the containers and forums showing as required:

When clicking on a:
- container the URL is: domain.com/container_name
- forum the URL is: domain.com/container_name/forum_name
- post the url is: domain.com/forum_name/post_name

The above results are from the following settings:

Pattern for all Forum topic paths
[node:taxonomy_forums]/[node:title]

Pattern for forums and forum containers
[term:parent]/[term:name]

One worry, whenever I have something in front of the post (ie "/forum_name/post_name") that alias gets added to the URL alias list. I presume that means every single post will have an alias?
Is this how it is here? Is this normal? I presume this slows down the forum speed, although not sure how much as I presume Drupal looks to see if there is an alias first every time anyway and so actually getting it isn't too much trouble (or cached..?)?

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Yes, that's completely normal. I don't think this is a big problem with speed. The biggest thing that slows things down is the number of database queries required to get things like the front page forum list. Each forum on that front page list (Webmaster's corner, etc.) is a separate query. So it takes ages to get all those queries and build the page. vBulletin gets all of that in one single query, so it's a lot faster (although their database structure is a mess.)

The Recent posts page is similar, because there are several separate tables needed to get all of that information, whereas vBulletin would store all that in one big table. Drupal has a better database structure, but it can make the queries more complex.

Welcome to Drupal, by the way!

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Thanks for the info

I've been trying out new modules, and just added the forum signature one, without realising who made it Sticking out tongue

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.