Documentation
¶
Index ¶
- func AddElement(w http.ResponseWriter, r *http.Request)
- func AddReference(w http.ResponseWriter, r *http.Request)
- func CreateReference(w http.ResponseWriter, r *http.Request)
- func DeleteElement(w http.ResponseWriter, r *http.Request)
- func DeleteReference(w http.ResponseWriter, r *http.Request)
- func EditElement(w http.ResponseWriter, r *http.Request)
- func Init(ctx context.Context, cms *cms.CMS) error
- func MoveElement(w http.ResponseWriter, r *http.Request)
- func Page(w http.ResponseWriter, r *http.Request)
- func Reference(w http.ResponseWriter, r *http.Request)
- func References(w http.ResponseWriter, r *http.Request)
- type AddElementData
- type AddReferenceData
- type Entry
- type PageTree
- type Ref
- type TemplateCfgCache
- type TemplateConfig
- type TemplateContent
- type TemplateCopy
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddElement ¶
func AddElement(w http.ResponseWriter, r *http.Request)
AddElement adds a new element to the page or to a parent element.
func AddReference ¶
func AddReference(w http.ResponseWriter, r *http.Request)
AddReference adds an existing reference to the parent element.
func CreateReference ¶
func CreateReference(w http.ResponseWriter, r *http.Request)
CreateReference creates a new reference for the given element.
func DeleteElement ¶
func DeleteElement(w http.ResponseWriter, r *http.Request)
DeleteElement deletes an element from a page.
func DeleteReference ¶
func DeleteReference(w http.ResponseWriter, r *http.Request)
DeleteReference deletes a reference.
func EditElement ¶
func EditElement(w http.ResponseWriter, r *http.Request)
EditElement updates the copy and data for an element.
func MoveElement ¶
func MoveElement(w http.ResponseWriter, r *http.Request)
MoveElement moves an element to a new position.
func Reference ¶
func Reference(w http.ResponseWriter, r *http.Request)
Reference renders the reference JSON editor.
func References ¶
func References(w http.ResponseWriter, r *http.Request)
References renders the references management dialog.
Types ¶
type AddElementData ¶ added in v1.1.0
type AddElementData struct {
Language string
Lang string
Path string
Element string
Templates []TemplateConfig
Positions map[string]TemplateContent
Template string
Position string
Errors map[string]string
}
AddElementData is the data required to render the element dialog.
type AddReferenceData ¶ added in v1.1.0
type AddReferenceData struct {
Language string
Lang string
Path string
Element string
References []Ref
Positions map[string]TemplateContent
Reference string
Position string
Errors map[string]string
}
AddReferenceData is the data required to render the reference dialog.
type PageTree ¶
type PageTree struct {
Language string
Lang string
Path string
Page *cms.Content
Positions map[string]string
ParentElement string
ElementPosition string
ElementDirection string
AddElement template.HTML
UpdateElement template.HTML
MoveElement string
DeleteElement string
}
PageTree is the data required to render the page tree.
type TemplateCfgCache ¶
type TemplateCfgCache struct {
// contains filtered or unexported fields
}
TemplateCfgCache is a cache for template configurations.
func NewTemplateCfgCache ¶ added in v1.1.2
func NewTemplateCfgCache() *TemplateCfgCache
NewTemplateCfgCache creates a new TemplateCfgCache.
func (*TemplateCfgCache) GetPositions ¶
func (c *TemplateCfgCache) GetPositions() map[string]string
GetPositions returns the template position mapping.
func (*TemplateCfgCache) GetTemplate ¶
func (c *TemplateCfgCache) GetTemplate(name string) (TemplateConfig, bool)
GetTemplate returns a template configuration by name.
func (*TemplateCfgCache) List ¶
func (c *TemplateCfgCache) List(filter []string) []TemplateConfig
List returns a list of all template configurations. The filter is optional.
func (*TemplateCfgCache) Load ¶
func (c *TemplateCfgCache) Load()
Load loads the template cache from disk.
type TemplateConfig ¶
type TemplateConfig struct {
Name string `json:"-"`
Label string `json:"label"`
Layout bool `json:"layout"`
Content map[string]TemplateContent `json:"content"`
Copy map[string]TemplateCopy `json:"copy"`
Data map[string]TemplateData `json:"data"`
}
TemplateConfig is the configuration for a template.
func (*TemplateConfig) Positions ¶
func (c *TemplateConfig) Positions() []string
Positions returns the available positions for the template.
type TemplateContent ¶ added in v1.1.0
TemplateContent is the configuration for a template content area.