Implementing Templates

Sep 14, 2007 at 2:17 PM
Hi,
u do really amazing job with N2 CMS.

I have a question how to implement ready templates to blank project ... for example:

I download n2examplecs1.2.4.zip, n2compiledruntime1.2.4.zip and N2.Templates.zip.
I was extract n2examplecs1.2.4.zip in some folder, override bin and edit directory and web.config in example project with items from n2compiledruntime1.2.4.zip.

Now, I want to have for example Search template from N2.Templates.zip implemented in that project.
I was copy N2.Templates.dll and N2.Templates.Search.dll and reference them in example project, and copy Search folder from root of application from N2.Templates.zip.

Compile is done without any errors, but when I want to create new item under site root, only Default page is offered to me, I cant see Search item offered....

What I miss?

Thank you.

Coordinator
Sep 14, 2007 at 10:28 PM
The item classes in the template project have parent type constraints in place:

[RestrictParents(typeof(IStructuralPage))]
public abstract class AbstractSearch : Templates.Items.AbstractContentPage ...

To allow your page as parent to the search pages you could implement the IStructuralPage interface (it's a marker interface).

Read more about this here http://n2cms.com/Documentation/Definition/Integrity.aspx

/Cristian
Sep 17, 2007 at 10:42 AM
Thank you Cristian,
thank you for answer .. I am using old templates package 1.2.3. with 1.2.4 example project and doesn't have that interface definition, but procedure it clear now.

BTW. Do u know aprox date when u plan to publish 1.2.4 Templates Package?

Thanks and keep going with good job.

/Dusan
Coordinator
Sep 17, 2007 at 6:33 PM
I'll probably publish a 1.2.5 version any day now. I'll make sure to include a compiled version of the templates.
Sep 18, 2007 at 6:52 AM
Great, thank you very much.