This project is read-only.

multiple sites with N2 CMS

Topics: Developer Forum
Sep 3, 2008 at 12:29 PM

I like N2 CMS, however i have a problem with multiple site option.
I added into C:\WINDOWS\system32\drivers\etc\hosts this 3 lines:

I also add in web.config multipleSites="true" into <host> .

However, i cant find where i should put code bellow:

[N2.Definition("Start Page")]
public class StartPage : TextPage, N2.Web.ISitesSource
    [N2.Details.EditableTextBox("Host", 100)]
    public virtual string Host
        get { return (string)(GetDetail("Host") ?? string.Empty); }
        set { SetDetail("Host", value, string.Empty); }

    public IEnumerable<N2.Web.Site> GetSites()
        yield return new N2.Web.Site(Parent.ID, ID, Host);

    public override string IconUrl
        get { return "~/Edit/img/ico/page_world.gif"; }

Can you pls help me?

Sep 3, 2008 at 7:22 PM
The code is the way to program a page that can be created on a site. It would make sense if you're implementing a custom CMS.

If you just want to try without coding you can download and set up the "compiled templates runtime". Once the site is up and running you can enter the domain name the start page nodes. Unfortunatly you'll need to restart the site before the changes takes effect.

Please share your experiences so I can improve the guide.