Adding a secondary forums page and limiting forums group view

rated by 0 users
This post has 6 Replies | 1 Follower

Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke Posted: Mon, Jun 5 2006 2:09 PM
This is a tip I'm reposting which was written by another member of the Developer Support Team in the hope that it may help you create a secondary Forums page on your Community Server 2.0 site and how to limit the forums view to specific forums groups.

Create your own new Forum Home Page and list forums you do not wish to display on the main forums page however you like.  Let's call it, "myforums.aspx".
 
Then edit the SiteUrls.config file, and change the following lines (search for them):
 
<url name="forumshome" location="forums" path="default.aspx" />
to
<url name="forumshome" location="forums" path="myforums.aspx" />
 
You might also want to edit the one for viewing Individual Groups:
 
<url name="forumGroup" path="default.aspx?GroupID={0}" location = "forums" />
to
<url name="forumGroup" path="myforums.aspx" location = "forums" />
 
Many different ways to edit it.  And yes, you can pass querystrings at will.
 
The reason why you want to edit the SiteUrls is the links to these areas are generated in many many places.  Editing the links in the SiteUrls.config will ensure that the links will render properly for the end-user, and go to the page you specify - throughout all of CS and the links it auto-generates. 
 
Also, notice the "location" attribute in the <url /> links above?  If you scroll to the top, you can see that the location for Forums is set to /forums/.
 
So "myforums.aspx" would need to exist in the /forums/ directory, because that is what the location prefixes.
 
Now if you want to place it in a different directory, make sure to change the location to match an entry at the top of the file.  Or create your own new location.



Not Ranked
Posts 9
Points 165
JonasB replied on Thu, Apr 26 2007 8:43 AM

So if I want 2 or more lists of forums groups how would you create the aspx pages for example "OtherForumGroupPage.aspx" and how do you select which groups to show on which list (some may go on two or more group lists).

First round lets say the lists are user independant so all users view the same groups in the grouplists.

Top 100 Contributor
Posts 247
Points 3,020
davelee replied on Sun, Jul 29 2007 2:48 PM

daveburke:

Now if you want to place it in a different directory, make sure to change the location to match an entry at the top of the file.  Or create your own new location.

How can the following be done in cs2007?...

I want to create a new main nav item, "Events", and display a particular Forum Group and all nested Forums, Posts under that group/page.  That's not a big deal, but-- and here's the tricky part-- I want all forums/posts under that group to reflect "Events", instead of "Forums", in the urls... and, of course, all site links to those posts/threads to do the same.

I initially thought I might be able to just copy/paste the SiteUrls/Location-Forum block, rename it to "Events", change path to "/events/", and everything under would reflect "events" in the urls/links.. ha, hardly seems to be that simple.

So, am I correct in now thinking this will require a fair amount of Source mods?  And, what would be the best approach to minimize mods for the most above functionality?

Any tips would be much appreciated!

David
  • | Post Points: 20
Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke replied on Tue, Jul 31 2007 12:07 AM

Dave,

I did this for a client not long ago.  You'd start by duplicating all forum links in the siteurls.config and renaming them from forum_ to events_.  You'd want to duplicate the ForumUrls.cs similarly and the classes that comprise the forums.  Lots of details here, and you're right that this would require a fair amount of source mods.  The beauty is that you're essentially duplicating forums with your own custom forums that can co-exist with the default Forums app.

Regards,
Dave

 

  • | Post Points: 20
Top 100 Contributor
Posts 247
Points 3,020
davelee replied on Tue, Jul 31 2007 12:45 PM

Yup.. that's more or less the means I've figured out.  I'm thrilled that it wasn't as hard as I anticipated and source mods are limited to a handful of files-- so I didn't duplicate the classes/project-- just modded existing.  The bulk being to ForumUrls.cs.. testing for ForumType.Events and FormattingUrls with copied/renamed "Events" location block items in SiteUrls.config.  A few mods to SiteUrls.cs and Forum/Breadcrumbs.cs.. and I'm off & running, so far.

Thanks for your reply Dave!

Oh.. one other thing while I have your ear.. Shouldn't subForum tags appear in thier parentForum's tagcloud?  Do you know how to accomplish this?  (without providing a string of specific ForumIDs)

David
  • | Post Points: 20
Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke replied on Tue, Jul 31 2007 1:26 PM

 Dave,

I'd have to think about the tagcloud issue.   I forgot about that aspect.

Oh, and one thing neither of us mentioned was the Resources.xml additions. :-)

Try to separate the controls as much as possible.  I left the files in the Forums project to speed-up development time and could have done a better job keeping everything separated at the class level.  Not a big deal, but since we're duplicating the page, there's no reason not to <DAVELEE:ThreadListIT />.

Regards,
Dave


 

  • | Post Points: 20
Top 100 Contributor
Posts 247
Points 3,020
davelee replied on Tue, Jul 31 2007 1:39 PM

I noticed the subForum/TagCloud issue before I ever did any of the above... in the default install... so it's not related to the mods.

It's just odd that, in a default/grouplist view the tagcloud reflects all forums/subforums.. yet,  naving "down" to forum containing subforums, tagcloud only shows the parent's tags.  Bug? or oversight?

Thanks!

David
  • | Post Points: 5
Page 1 of 1 (7 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com