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.

  1. title An arbitrary title field *
  2. text
  3. text_small
  4. text_medium
  5. text_email
  6. text_url
  7. text_money
  8. textarea
  9. textarea_small
  10. textarea_code
  11. text_time Time picker
  12. select_timezone Time zone dropdown
  13. text_date_timestamp Date Picker (UNIX timestamp)
  14. text_datetime_timestamp Text Date/Time Picker Combo (UNIX timestamp)
  15. text_datetime_timestamp_timezone Text Date/Time Picker/Time zone Combo (serialized DateTime object)
  16. hidden Hidden input type
  17. colorpicker Color picker
  18. radio *
  19. radio_inline *
  20. taxonomy_radio *
  21. taxonomy_radio_inline *
  22. select
  23. taxonomy_select *
  24. checkbox *
  25. multicheck and multicheck_inline
  26. taxonomy_multicheck *
  27. taxonomy_multicheck_inline
  28. wysiwyg (TinyMCE) *
  29. file Image/File upload *†
  30. file_list Image/File list upload
  31. oembed Converts oembed urls (instagram, twitter, youtube, etc. oEmbed in the Codex)
  32. group Hybrid field that supports adding other fields as a repeatable group. *

For more details read this article https://github.com/WebDevStudios/CMB2/wiki/Field-Types

Categories
Most Popular