eadam
eadam

Reputation: 26121

N2CMS Issues creating template first parts

What is the proper way of adding template first part as shown here..https://n2cmsdocs.atlassian.net/wiki/plugins/servlet/mobile#content/view/524349

I have done the same thing in my mvc project and the part appear in the drag drop list with the name of "ContentPart". When I edit the part, an empty page shows up.

If I add more parts in /views/ContentParts/ folder, they don't show up in the drag drop list.

I have tried copying several parts from dinamico source but they don't appear in the list. Please help

Upvotes: 0

Views: 391

Answers (1)

Ben H
Ben H

Reputation: 3236

Your view or model must define some editable fields. If you're defining the fields in your view (as in the Dinamico template pack) you can do this with the Content.Define function, i.e.

@model Dinamico.Models.ContentPart
@{ 
  Content.Define(a => /* add definitions here */);
}

If you're doing it from your model, you can decorate public properties with attributes like [EditableText] to make them show up in the edit form automatically.

There are many built-in editor types which are discussed in the documentation here: https://n2cmsdocs.atlassian.net/wiki/display/N2CMS/Built-in+Editor+Types

Upvotes: 1

Related Questions