mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
set page sequence based on page type
This commit is contained in:
parent
f2734edfae
commit
c3b13f1626
11 changed files with 42 additions and 35 deletions
|
@ -194,12 +194,25 @@ type Page struct {
|
|||
func (p *Page) SetDefaults() {
|
||||
if len(p.ContentType) == 0 {
|
||||
p.ContentType = "wysiwyg"
|
||||
p.PageType = "section"
|
||||
}
|
||||
|
||||
if p.IsTabType() {
|
||||
p.Sequence = 0
|
||||
}
|
||||
|
||||
p.Title = strings.TrimSpace(p.Title)
|
||||
}
|
||||
|
||||
// IsSectionType tells us that page is "words"
|
||||
func (p *Page) IsSectionType() bool {
|
||||
return p.PageType == "section"
|
||||
}
|
||||
|
||||
// IsTabType tells us that page is "SaaS data embed"
|
||||
func (p *Page) IsTabType() bool {
|
||||
return p.PageType == "tab"
|
||||
}
|
||||
|
||||
// PageMeta holds raw page data that is used to
|
||||
// render the actual page data.
|
||||
type PageMeta struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue