0

I've set up a forum on ExpressionEngine and customised the URL as I want a specific path to the forum.

To do this I went to Modules > Discussion Forum > Forum Board Preferences and in the Forum URL put in my desired URL. Let's call it http://www.mywebsite.com/students/forum/

My homepage displays the latest 5 posts from the forum. It all works except for the URLs which don't go to this URL and instead point to http://www.mywebsite.com/forums/viewthread/xxx

Is there an extra step I am missing here? Why doesn't the forum URL just update automatically when I save it?

Steph
  • 635
  • 7
  • 22
  • Update: I found {auto_thread_path} in the documentation as the suggested tag to use if you have a custom URL and even thought it pulls out the correct thread URL it doesn't load the page! – Steph Nov 25 '11 at 14:21
  • The `{auto_thread_path}` is used for building URLs for use in front-end templates when [displaying forum topics](http://expressionengine.com/user_guide/modules/forum/recent_forum_topics.html#auto-thread-path) – it's *not used* for configuring what URL the Forum lives on. – rjb Nov 25 '11 at 18:02

1 Answers1

0

A default ExpressionEngine installation assumes that the forum will always reside at the URL:

http://example.com/index.php/forums

Although you can freely change the URL of the forum, the Discussion Forum Module logic expects the forum to be the first URL Segment Variable, {segment_1} of the URI.

This information isn't as widely documented as it should be, and provides a lot of confusion for people who wish to run their forum at a different URL or on a subdomain.

To enable the Discussion Forum to run as a different URL — on the second segment {segment_2} — you'll need to configure EE to run the forum through regular templates*.

In your example, you'll want to:

  1. Create a new template group: students
  2. Within that template group, create a new template: forum
  3. In the forum template, put the following code: {exp:forum}
  4. From the Control Panel, go to Add-Ons > Modules > Discussion Forum > Default Preferences
  5. Configure your Forum Board Preferences to the following:

Forum Board Label: Students Forum
Forum Forum Board Short Name: forum
Forum URL: http://example.com/index.php/students/forum
Forum Triggering Word: <empty>

ExpressionEngine Forum Module Board Preferences

At this point, your forum will then be run inside the regular EE templating engine. The forum is then accessed through whichever template you created above — the template name is used in place of the "trigger" word mentioned earlier:

http://example.com/index.php/students/forum


The down side of this approach is that it adds more processing overhead, so it's not recommended unless users really need this capability. Since the forum can’t be cached, on very busy sites this can create some unwanted server load.

Do not cache the Template you create for the forum. If you do so, your forum will not behave dynamically.

rjb
  • 9,036
  • 2
  • 44
  • 49