Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] add input type specifier to generate content command #107

Merged
merged 9 commits into from
Apr 2, 2017

Conversation

nilslice
Copy link
Contributor

@nilslice nilslice commented Apr 2, 2017

As referenced in the community suggestion project, this PR adds the ability to define which type of HTML input to show in an editor view for a content type in the CMS.

The specifier is entirely optional, and if not added the behavior is exactly the same as prior versions. To use, add a third parameter to the generated field, like so:

$ ponzu gen c song title:string artist:string:input description:string:richtext genre:string:select

In the content/song.go file generated, the fields' views will automatically be the following:
Title: Input
Artist: Input
Description: Richtext
Genre: Select

This saves time in the set-up phase for your content types and should also be helpful if you're looking for documentation on how to use each editor input func from the editor package. The following input view types are implemented:

CLI parameter Generates
checkbox editor.Checkbox()
custom generates a pre-styled empty div to fill with HTML
file editor.File()
hidden editor.Input() + uses type=hidden
input, text editor.Input()
richtext editor.Richtext()
select editor.Select()
textarea editor.Textarea()
tags editor.Tags()

@nilslice nilslice merged commit fe5367c into master Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant