0

I'm trying to integrate N2CMS into an existing application. I'm in the middle of the installation and have been following the documentation supplied for integrating into an existing application.

I'm up to the 'Add Content Package' part of the installation'. However, the 'HomePage' start page is not appearing under the 'start node' drop down list (under 'Manually Insert Nodes'). I've been trying to figure this out for a few days now, looking at various sources but nothing seems to work.

I'll post the Content Item below (the cs code that the installer should be picking up on). All I really need is a CMS that is easy to integrate into an existing website, which is why I went with N2CMS. But the poorly maintained documentation and lack of support really makes me want to try something else. Unfortunately every CMS wants you to use their system from scratch. If anyone knows another Open Source CMS which is easy to integrate into an existing website, please let me know.

Here's the cs code (HomePage.cs, under the 'Models' Folder)

namespace ExistingApplication.Models
{

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using N2;
using N2.Web;
using N2.Details;
using N2.ContentItem;
using N2.Installation;

[N2.Definition("My page", "MyPage", "A simple page with a chunk of text", "The tooltip", 1, Installer = InstallerHint.PreferredStartPage, TemplateUrl = "~/UI/Home.aspx")]

[N2.Details.WithEditableTitle, N2.Details.WithEditableName]

public class HomePage : N2.ContentItem
  {

  }

}

By the way the url that 'TemplateUrl' points to does exist. Thanks in advance.

Ethan Korolyov
  • 313
  • 2
  • 6

1 Answers1

0

Try modifying HomePage definition by implementing (empty) interface IStartPage

public class HomePage : N2.ContentItem, IStartPage

IStartPage is marker interface that is used exactly for this purpose - so that N2 can distinguish regular pages from those that can serve as Start Page of the site.

Dejan Milicic
  • 819
  • 9
  • 18
  • Didn't seem to work. Still only showing up with Root Page (fallback) under 'start node' drop-down list. – Ethan Korolyov Nov 26 '12 at 04:12
  • Can you try adding InstallerVisibility = InstallerHint.PreferredStartPage to PageDefinition? – Dejan Milicic Nov 26 '12 at 07:51
  • Yes, you can manually add start page too. Complete installation by adding RootPage as "single node". After that, go to N2 administration, create new StartPage node under root. Hover with mouse over it to see its ID. Then, go to App_Data/n2_host.config and manually set startPageID="xxx" where xxx is ID of StartPage node you just added. This will work for sure, but please try my previous comment first and let me know if it works. – Dejan Milicic Nov 26 '12 at 07:55
  • Thanks, I manually added the start page and it worked. I didn't try your first option, sorry. Really trying to get this done fast. – Ethan Korolyov Nov 26 '12 at 13:41