Following the official episerver documentation, there is a guide to how to create a new page. There seems to be nothing similar on how to create a block. I have also read "the missing manual" which is also missing this information.
I am guessting I need 3 files:
- Models/Blocks/MyBlock.cs
- Controllers/MyBlock.cs
- Views/MyBlock.cshtml
In VS, if I "add new" and select the epiplugin, I see:
- Block Type (is this the model?)
- Block controller(MVC)
- Block partial View (MVC razor)
- etc.
I assume block type = model, block controller = conroller, and block partial view = view.
This seems to work - I can create a insatance f MyBlock in the CMS editor.
How do I put an area on a page which this block can be added? I cant find this in the docs.
I found this snippet in the missing manual, and put this on my hello world page model, but it doesnt work (nothing shown, only my existing title and body strings). I also tried creating a new page with my single page type, but still no content block where I can drag a block. What am i missing?
[Display(
Name = "Main Content Area",
GroupName = SystemTabNames.Content,
Order = 200)]
public virtual ContentArea MyContentArea { get; set; }
}