summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/ponzu/contentType.tmpl5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/ponzu/contentType.tmpl b/cmd/ponzu/contentType.tmpl
index 6d68dfa..eccd525 100644
--- a/cmd/ponzu/contentType.tmpl
+++ b/cmd/ponzu/contentType.tmpl
@@ -20,8 +20,7 @@ func ({{ .Initial }} *{{ .Name }}) MarshalEditor() ([]byte, error) {
view, err := editor.Form({{ .Initial }},
// Take note that the first argument to these Input-like functions
// is the string version of each {{ .Name }} field, and must follow
- // this pattern for auto-decoding and auto-encoding reasons:
- {{ $initial := .Initial }}
+ // this pattern for auto-decoding and auto-encoding reasons:{{ $initial := .Initial }}
{{ range .Fields }}editor.Field{
View: editor.Input("{{ .Name }}", {{ $initial }}, map[string]string{
"label": "{{ .Name }}",
@@ -44,7 +43,7 @@ func init() {
// ContentName is required to set the display name for a piece of content in the editor
// Partially implements editor.Editable
-func ({{ .Initial }} *{{ .Name }}) ContentName() string { return fmt.Sprintf("{{ .Name }} - ID: %d", {{ .Initial }}.ItemID()) }
+func ({{ .Initial }} *{{ .Name }}) ContentName() string { return fmt.Sprintf("{{ .Name }} - ID: %d", {{ .Initial }}.UniqueID()) }
// Editor is a buffer of bytes for the Form function to write input views
// partially implements editor.Editable