Documentation / Tutorials / Triggers
Creating Meta Boxes
/ Triggers / Creating Meta Boxes
Create a Global Triggers and it will create a Meta box, it takes all the parameter of CMB2, fields are added separately
[aw2.register metabox part=start id=gallery]
{
"id" :"gallery",
"title" :"Gallery",
"object_types" : [ "as_gallery" ],
"context" :"normal",
"priority" :"high",
"show_names" : true
}
[/aw2.register]
[aw2.register metabox part=field id=gallery]
{
"name":"Images",
"id" : "gallery_images",
"type":"file_list"
}
[/aw2.register]
Various Fields Type
Here's the built-in fields you can include in your metabox. You can also add your own field types.
titleAn arbitrary title field *texttext_smalltext_mediumtext_emailtext_urltext_moneytextareatextarea_smalltextarea_codetext_timeTime pickerselect_timezoneTime zone dropdowntext_date_timestampDate Picker (UNIX timestamp)text_datetime_timestampText Date/Time Picker Combo (UNIX timestamp)text_datetime_timestamp_timezoneText Date/Time Picker/Time zone Combo (serialized DateTime object)hiddenHidden input typecolorpickerColor pickerradio*radio_inline*taxonomy_radio*taxonomy_radio_inline*selecttaxonomy_select*checkbox*multicheckandmulticheck_inlinetaxonomy_multicheck*taxonomy_multicheck_inlinewysiwyg(TinyMCE) *fileImage/File upload *†file_listImage/File list uploadoembedConverts oembed urls (instagram, twitter, youtube, etc. oEmbed in the Codex)groupHybrid field that supports adding other fields as a repeatable group. *
For more details read this article https://github.com/WebDevStudios/CMB2/wiki/Field-Types