[cli] add input type specifier to generate content command #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:editor.Checkbox()
editor.File()
editor.Input()
+ uses type=hiddeneditor.Input()
editor.Richtext()
editor.Select()
editor.Textarea()
editor.Tags()