Documentation
¶
Index ¶
- type HTMLBlockType
- func (t *HTMLBlockType) GetAdminFields(block cmsstore.BlockInterface, r *http.Request) interface{}
- func (t *HTMLBlockType) Render(ctx context.Context, block cmsstore.BlockInterface, ...) (string, error)
- func (t *HTMLBlockType) SaveAdminFields(r *http.Request, block cmsstore.BlockInterface) error
- func (t *HTMLBlockType) TypeKey() string
- func (t *HTMLBlockType) TypeLabel() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTMLBlockType ¶
type HTMLBlockType struct{}
HTMLBlockType provides both frontend rendering and admin UI for HTML blocks.
This is a built-in block type that renders raw HTML content. It includes a CodeMirror editor in the admin UI for syntax highlighting.
func NewHTMLBlockType ¶
func NewHTMLBlockType() *HTMLBlockType
NewHTMLBlockType creates a new HTML block type.
func (*HTMLBlockType) GetAdminFields ¶
func (t *HTMLBlockType) GetAdminFields(block cmsstore.BlockInterface, r *http.Request) interface{}
GetAdminFields returns form fields for editing HTML block content.
func (*HTMLBlockType) Render ¶
func (t *HTMLBlockType) Render(ctx context.Context, block cmsstore.BlockInterface, opts ...cmsstore.RenderOption) (string, error)
Render renders an HTML block by returning its content as-is. Supports optional 'wrap' attribute to wrap content in an HTML element.
func (*HTMLBlockType) SaveAdminFields ¶
func (t *HTMLBlockType) SaveAdminFields(r *http.Request, block cmsstore.BlockInterface) error
SaveAdminFields processes form submission and updates the HTML block.
func (*HTMLBlockType) TypeKey ¶
func (t *HTMLBlockType) TypeKey() string
TypeKey returns the unique identifier for HTML blocks.
func (*HTMLBlockType) TypeLabel ¶
func (t *HTMLBlockType) TypeLabel() string
TypeLabel returns the display name for HTML blocks.