Comments (9)
I am running go1.8
ponzu version 0.9.1
ponzu --cli version 0.9.1
from ponzu.
Could you paste the generated review.go file here too? Did you edit it at all or immediate just build and run?
Also, can you try visiting http://localhost:8080/admin/edit?type=Review
It's strange that you're able to run the project but the content type isn't showing.
from ponzu.
package content
import (
"fmt"
"github.com/ponzu-cms/ponzu/management/editor"
"github.com/ponzu-cms/ponzu/system/item"
)
type Review struct {
item.Item
Title string `json:"title"`
Author string `json:"author"`
Rating float64 `json:"rating"`
Body string `json:"body"`
WebsiteUrl string `json:"website_url"`
Items []string `json:"items"`
Photos []string `json:"photos"`
}
// MarshalEditor writes a buffer of html to edit a Review within the CMS
// and implements editor.Editable
func (r *Review) MarshalEditor() ([]byte, error) {
view, err := editor.Form(r,
// Take note that the first argument to these Input-like functions
// is the string version of each Review field, and must follow
// this pattern for auto-decoding and auto-encoding reasons:
editor.Field{
View: editor.Input("Title", r, map[string]string{
"label": "Title",
"type": "text",
"placeholder": "Enter the Title here",
}),
},
editor.Field{
View: editor.Input("Author", r, map[string]string{
"label": "Author",
"type": "text",
"placeholder": "Enter the Author here",
}),
},
editor.Field{
View: editor.Input("Rating", r, map[string]string{
"label": "Rating",
"type": "text",
"placeholder": "Enter the Rating here",
}),
},
editor.Field{
View: editor.Input("Body", r, map[string]string{
"label": "Body",
"type": "text",
"placeholder": "Enter the Body here",
}),
},
editor.Field{
View: editor.Input("WebsiteUrl", r, map[string]string{
"label": "WebsiteUrl",
"type": "text",
"placeholder": "Enter the WebsiteUrl here",
}),
},
editor.Field{
View: editor.Input("Items", r, map[string]string{
"label": "Items",
"type": "text",
"placeholder": "Enter the Items here",
}),
},
editor.Field{
View: editor.Input("Photos", r, map[string]string{
"label": "Photos",
"type": "text",
"placeholder": "Enter the Photos here",
}),
},
)
if err != nil {
return nil, fmt.Errorf("Failed to render Review editor view: %s", err.Error())
}
return view, nil
}
func init() {
item.Types["Review"] = func() interface{} { return new(Review) }
}
from ponzu.
Error:
There is no type registered for Review
Add this to the file which defines Review{} in the 'content' package:
func init() {
item.Types["Review"] = func() interface{} { return new(Review) }
}
This is what I get when I visit the link above
from ponzu.
Hmm.. what is the output of pwd
from within the directory you are executing ponzu run
?
from ponzu.
/Users/nem/go/src/github.com/wearevest/vestCMS is the output of pwd
I just got it working when I reinstalled it in a different place. i'm going to try to reinstall
from ponzu.
Ok, great - go ahead and close this issue if your new build works. Otherwise let me know and I will try to continue help w/ debugging.
from ponzu.
It's working now, I'm not exactly sure why. If I have any other problems I will let you know thank you.
from ponzu.
Sounds good! Glad it's working now
from ponzu.
Related Issues (20)
- CLI is not working HOT 14
- Zap v11 was deleted HOT 14
- go module support HOT 9
- search sort HOT 2
- Custom databases HOT 3
- ponzu 0.11.0 fails to build HOT 2
- The "must" search operator in blevesearch can't be passed into ponzu HOT 1
- NOTICE: original author & maintainer is stepping away from the project HOT 7
- how to change to Summernote
- Redis Support for ponzu
- There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.
- Only latest tag saving
- Error with "go get..." HOT 6
- Current state of Ponzu HOT 1
- Is this project still maintained? HOT 3
- Suggested install method no longer works HOT 2
- Is Ponzu dead? HOT 10
- Potential goroutine leak in achive.go
- How can you develop addons more efficiently?
- How to setup development env
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ponzu.