You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a small cms and creating blocks of html content like medium.com. For doing that I need to use the rich editor for the sub-blocks in the admin form.
How can I apply the rich_editor meta to additional blocks like in the screenshot ?
Please find below my test code.
package main
import (
"fmt""net/http""github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3""github.com/qor/admin""github.com/qor/media/media_library""github.com/qor/publish2"
qor_seo "github.com/qor/seo""github.com/qor/slug"
)
typeUserstruct {
gorm.ModelUsernamestringEmailstringDisabledbool
}
typePagestruct {
gorm.ModelUserUserUserIDuintTitlestring`gorm:"type:mediumtext; CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" sql:"type:mediumtext"`Contentstring`gorm:"type:longtext; CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" sql:"type:longtext"`TitleWithSlug slug.SlugBlocks []BlockMedia media_library.MediaLibrary
publish2.Version
publish2.Schedule
publish2.VisibleSeo qor_seo.Setting
}
typeBlockstruct {
gorm.ModelPageIDuintTitlestring`gorm:"type:mediumtext; CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" sql:"type:mediumtext"`Descriptionstring`gorm:"type:longtext; CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" sql:"type:longtext"`Media media_library.MediaLibrary
}
funcmain() {
DB, _:=gorm.Open("sqlite3", "cms.db")
DB.AutoMigrate(&User{})
DB.AutoMigrate(&Page{})
DB.AutoMigrate(&Block{})
// InitializeAdmin:=admin.New(&admin.AdminConfig{DB: DB})
// Allow to use Admin to manage User, ProductAdmin.AddResource(&User{})
page:=Admin.AddResource(&Page{})
page.Meta(&admin.Meta{
Name: "Content",
Type: "rich_editor",
})
// initalize an HTTP request multiplexermux:=http.NewServeMux()
// Mount admin interface to muxAdmin.MountTo("/admin", mux)
fmt.Println("Listening on: 9000")
http.ListenAndServe(":9000", mux)
}
Thanks in advance for your help and insights about that.
Cheers,
X
The text was updated successfully, but these errors were encountered:
Hi,
Hope you are all well !
I would like to create a small cms and creating blocks of html content like medium.com. For doing that I need to use the rich editor for the sub-blocks in the admin form.
How can I apply the rich_editor meta to additional blocks like in the screenshot ?
Please find below my test code.
Thanks in advance for your help and insights about that.
Cheers,
X
The text was updated successfully, but these errors were encountered: