1

I'm using Drupal (v7.21) with Pathauto and Advanced Forum and would like the paths to be formatted like:

domain.com/forum
domain.com/forum/the_topic_name
domain.com/forum/the_topic_name/the_post_name

Under Forum Paths 'Pattern for forums and forum containers' is set as:

[term:vocabulary]/[term:name]

And under Content Paths I've set 'Pattern for all Forum topic paths' as:

[node:taxonomy_forums]/[node:title]

This is working except for the Posts which are missing the /forum/ part:

domain.com/the_topic_name/the_post_name

I could manually get this to work by setting the 'Pattern for all Forum topic paths' as:

forum/[node:taxonomy_forums]/[node:title]

But I'd rather have it set using a pattern if possible.

Any ideas?

1
  • you can just add forum/ to the beginning of 'Pattern for forums and forum containers' & 'Pattern for all Forum topic paths'
    – Jayaram
    Mar 27 '13 at 15:40
2

you can add pattern like [node:content-type] or [node:content-type:name]. So the actual pattern will be [node:content-type]/[node:taxonomy_forums]/[node:title]

2
  • [node:content-type] and [node:content-type:name] give: '/forum-topic/'
    – RebDev
    Mar 28 '13 at 7:51
  • try [node:content-type:machine-name] pattern
    – monymirza
    Mar 28 '13 at 7:58
0

From the answer by monymirza it works as:

set Pattern for all Forum topic paths as
[node:content-type:machine-name]/[node:taxonomy_forums]/[node:title]

It also works with:

set Pattern for all Forum topic paths as
[node:taxonomy-forums:vocabulary]/[node:taxonomy-forums:name]/[node:title]

But if you have a Topic within sub Forums/Containers it won't show them in the urls for Topics. So from more research I found that you can get Topics to show the correct path with:

set Pattern for all Forum topic paths as
[node:taxonomy-forums:vocabulary]/[node:taxonomy-forums:parent]/[node:taxonomy-forums:name]/[node:title]

You then need to set the pattern for the Forum/Container paths as they are separate:

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

For both of these if you have multiple levels of sub categories you can keep extending this with 'parent:parent' like:

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

If I've missed anything please let me know as I'm very new to Drupal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.