Documentation
¶
Index ¶
- type MenuBlockType
- func (t *MenuBlockType) GetAdminFields(block cmsstore.BlockInterface, r *http.Request) interface{}
- func (t *MenuBlockType) GetCustomVariables() []cmsstore.BlockCustomVariable
- func (t *MenuBlockType) Render(ctx context.Context, block cmsstore.BlockInterface, ...) (string, error)
- func (t *MenuBlockType) SaveAdminFields(r *http.Request, block cmsstore.BlockInterface) error
- func (t *MenuBlockType) TypeKey() string
- func (t *MenuBlockType) TypeLabel() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MenuBlockType ¶
type MenuBlockType struct {
// contains filtered or unexported fields
}
MenuBlockType provides both frontend rendering and admin UI for menu blocks.
This is a built-in block type that renders navigation menus with various styles.
func NewMenuBlockType ¶
func NewMenuBlockType(store cmsstore.StoreInterface, logger interface { Error(msg string, args ...interface{}) }) *MenuBlockType
NewMenuBlockType creates a new menu block type.
func (*MenuBlockType) GetAdminFields ¶
func (t *MenuBlockType) GetAdminFields(block cmsstore.BlockInterface, r *http.Request) interface{}
GetAdminFields returns form fields for editing menu block configuration.
func (*MenuBlockType) GetCustomVariables ¶ added in v1.26.0
func (t *MenuBlockType) GetCustomVariables() []cmsstore.BlockCustomVariable
GetCustomVariables returns nil as menu blocks do not set any custom variables.
func (*MenuBlockType) Render ¶
func (t *MenuBlockType) Render(ctx context.Context, block cmsstore.BlockInterface, opts ...cmsstore.RenderOption) (string, error)
Render renders a menu block by loading menu items and generating HTML. Supports runtime attributes: depth, style, class, id for dynamic configuration.
func (*MenuBlockType) SaveAdminFields ¶
func (t *MenuBlockType) SaveAdminFields(r *http.Request, block cmsstore.BlockInterface) error
SaveAdminFields processes form submission and updates the menu block.
func (*MenuBlockType) TypeKey ¶
func (t *MenuBlockType) TypeKey() string
TypeKey returns the unique identifier for menu blocks.
func (*MenuBlockType) TypeLabel ¶
func (t *MenuBlockType) TypeLabel() string
TypeLabel returns the display name for menu blocks.