pessek/hypepostadmin

Admin interface for managing post schema

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:elgg-plugin

v1.0.4 2021-05-31 12:59 UTC

This package is auto-updated.

Last update: 2024-03-29 04:26:42 UTC


README

Interactive form builder for managing post schema

This plugin provides an admin interface to extend forms created with hypePost. Dependening on the plugins you have installed, it will provide a set of input fields to choose from, including:

  • Text
  • Plaintext
  • WYSIWYG
  • Dropdown / Select
  • Checkboxes / Radios
  • Boolean / Toggle
  • Number
  • Email
  • URL
  • Tags
  • Date
  • Time (hypeTime)
  • User Picker (hypeAutocomplete)
  • Group Picker (hypeAutocomplete)
  • File Attachments (hypeAttachments)
  • Captcha (hypeCaptcha)
  • Country (hypeCountries)
  • Address (hypeCountries)

Registering new field type

You can register custom field types. See hypePost to understand how field adapters work.

elgg_register_plugin_hook_handler('field_types', 'post', function(Hook $hook) {
   $fields = $hook->getValue();
   
   $fields[] = [
       'type' => 'postal_code', // corresponds to input/postal_code view
       'config' => [],
       'adapter' => function($params, $entity) {
           return new MetaField($params);
       },
   ];
   
   return $fields;
});