Block List Editor
Value Type Saved: List<Content>
Last updated
Value Type Saved: List<Content>
Last updated
The Block List Editor allows you to pick Element Types and update the content directly in the editor, save and sort the content. It then displays the content item in a list of blocks.
The blocks are customisable and you can display custom content in them using the IContentBlockPreview
. In addition, for rendering on the front end, you can create a view to match the block using the IContentBlock
Then you can use the built in component to render the blocks
To display data in the front end, you create a Blazor component and implement IContentBlock. Example below is a QuoteBlock.razor
from my blog.
Your ContentTypeAlias is the Element Type alias and you just use the Content property like you do in the normal ContentViews.
To customise what you see in the admin section, you can override the default view and render a component. A lot of the time you will just want to render the Content Block, and because this is Blazor you can easily reuse blocks. The example below, is for the quote block again, where I just render the original QuoteBlock.razor
in my QuoteBlockPreview.razor
.
You can style the block list editor in the admin to match your website by linking your front end style sheet in the Block List Editor Settings. Just click on the settings icon on your Block List Editor and add the CSS file path. Must be relative to your website root, like you would add in your code.
Once this is done, ZauberCMS uses the shadow DOM to append the style sheet so your custom styles, only affect the blocks and not the rest of the admin. You can make the editing experience pretty nice! Below is my blog, I have set up the components and the styles.