pessek/hypepost

Utility plugin for quick prototyping of content posts

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:elgg-plugin

v1.9.2 2021-05-29 12:36 UTC

This package is auto-updated.

Last update: 2024-11-29 06:16:42 UTC


README

Provides utilities for creating and editing posts.

Extendable form fields Post forms are built using an extended field API layer, which makes it easier to define all fields in one place, and not have to worry about maintaining form, action and profile logic separate from each other.

Reusable views Plugins can recycle existing resource views, saving lots of time needed to bootstrap new entity types.

Client site validation Client side form validation

AJAX form save Forms are saved using AJAX with saves user a few steps should the action fail.

Form Fields

To extend post form, use fields, <entity_type>:<entity_subtype> (or less granular fields, <entity_type> ) plugin hook.

The hook receives an instance of \hypeJunction\Fields\Collection, which allows you to easily manipulate fields:

elgg_register_plugin_hook_handler('fields', 'object:blog', function(\Elgg\Hook $hook) {

	$fields = $hook->getValue();
	/* @var $fields \hypeJunction\Fields\Collection */
	
	$fields->add('published_date', new MetaField([
		'type' => 'date',
		'required' => true,
	]);
	
	$fields->get('description')->required = false;
	
	return $fields;
});

Features

Icons

To enable or disable icons, use uses:icon, <entity_type>:<entity_subtype> hook. The handler should return true or false

Cover Images

To enable or disable cover images, use uses:cover, <entity_type>:<entity_subtype> hook. The handler should return true or false

Comments

To enable or disable comments, use uses:comments, <entity_type>:<entity_subtype> hook. The handler should return true or false