menu

package
v1.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRenderer

type BlockRenderer struct {
	// contains filtered or unexported fields
}

BlockRenderer renders menu blocks by loading menu items and generating HTML

func NewBlockRenderer

func NewBlockRenderer(store FrontendStore) *BlockRenderer

NewBlockRenderer creates a new menu block renderer

func (*BlockRenderer) Render

func (r *BlockRenderer) Render(ctx context.Context, block cmsstore.BlockInterface) (string, error)

Render renders a menu block by loading the menu and rendering it as HTML

type FrontendStore

type FrontendStore interface {
	MenuFindByID(ctx context.Context, id string) (cmsstore.MenuInterface, error)
	MenuItemList(ctx context.Context, query cmsstore.MenuItemQueryInterface) ([]cmsstore.MenuItemInterface, error)
	MenusEnabled() bool
	PageFindByID(ctx context.Context, id string) (cmsstore.PageInterface, error)
	Logger() *slog.Logger
}

FrontendStore interface for store operations needed by menu renderer

type MenuRenderer struct {
	// contains filtered or unexported fields
}

MenuRenderer provides comprehensive menu rendering functionality

func NewMenuRenderer

func NewMenuRenderer(store FrontendStore) *MenuRenderer

NewMenuRenderer creates a new menu renderer

func (r *MenuRenderer) RenderMenuHTML(ctx context.Context, menuItems []cmsstore.MenuItemInterface, style, cssClass string, startLevel, maxDepth int) (string, error)

RenderMenuHTML renders menu items as HTML based on the specified style

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL