Wednesday, February 6, 2008

Integrating into Umbraco

Tools needed
- Installed Umbraco installation
- Installed YetAnotherForum Application
- Download this (yaf.dll)

How to install YAF
- Download latest release version from (Version at time of writing)
- Extract files into any directory
- Rename default.config to web.config
- Configure yafnet.config with connection to MSSQL database you want to use (tables use a yaf_ naming connection so should be any problems using Umbraco database, however I put it on a separate database)
- Create an application through IIS pointing to the directory where YAF is located.
- Run application and run through install.

Integrate YAF into existing Umbraco Installation
- Copy bits from web.config (YAF directory) to Web.config (Umbraco Installation)
- Copy directories and files from yaf directory to umbraco directory (don’t need default.aspx) as you can see this can get a bit messy
- Copy yaf.dll downloaded before into Bin directory.
- Create a new UserControl (forum.ascx)

<%@ Control Language="C#" ClassName="WebUserControl1" %>
<%@ Register TagPrefix="yaf" Namespace="yaf" Assembly="yaf" %>
<%@ Register TagPrefix="yc" Namespace="yaf.controls" Assembly="yaf" %>
<form id="Form1" runat="server" enctype="multipart/form-data">
<yaf:forum runat="server" id="forum" />

- Upload usercontrol to umbraco usercontrol directory
- Create a new Umbraco macro and select the forum.ascx
- Insert into Umbraco template.
- Create a new page called Forum (if you don’t want to call the page Forum you need to download the 1.9.1 YAF source and change the file Classses\UrlBuilder.cs)


Skiltz said...

Today I ran through the installation on another site and it all worked as descibed above. I do have some improvments to make however.

- put all the YAF files in a YAF directory and in the yaf.config file add this *<*root>YAF*<*/root> (remove stars)
-in the web.config don't any refrences to the urlrewriter stuff.
-don't need to copy the url rewriting stuff to the bin directory.
-I also installed YAF on the database as umbraco and all seems to be playing nicely.

Obvisouly in the future it would be nice to get the Url Rewriting stuff to work but for now just getting the YAF forum working with Umbraco is pretty cool.

Karl said...

Nice work - love bringing the pieces together :)

Windstorm said...

Does this integrate with umbraco members? If site members log in at the umbraco front end, can they then use the forum without having to log in separately there?

Skiltz said...

No they would need to login twice. As soon as Umbraco goes to 3.1 and Yet Anther Forum goes to the next version (can't remember the number sorry) both will use the Membership providers and then this should work (with some customization)

Adam Perry said...

I have been integrating YAF with Umbraco (4, beta) and came across your post a little late - as I already covered most of what you have described!

One thing I did differently:

Instead of recompiling yaf.dll, I used url-rewriting.

1) Create a content node which will display the forum, and name it "The Forum" which resolves to "the-forum.aspx".

2) Ensure that there is no node in Umbraco called "forum" (maybe make it a forbidden url can't remember how)

3) Update urlRewriting.config as follows:

<!-- Redirect any requests for the-forum.aspx to forum.aspx -->
<add name="forum-redirect"
redirectMode="Permanent" />

<!-- Internally rewrite the url -->
<add name="forum-rewrite"
ignoreCase="true" />

Veroljub Zmijanac said...

Hi, could you please share one more time dll, because link is broken..

thanks.. I am getting error
he virtual path '/default.aspx' maps to another application, which is not allowed.
hole day :((

kcuk said...

your of the dll download link is broken? can you repost?

Veroljub Zmijanac said...

Now, I have it :)

Mail me on on my account "veroljub". It's google mail :))

kcuk said...

hey dropped you an email on Friday check for an email domain kcuk and the name kev let me know if you got it ok?

Skiltz said...