Aloha Editor

Aloha Guides

These guides help you to make your content editable and to develop Aloha.

The Block Plugin

After reading this guide, you will be able to:

  • Understand what Blocks are and how to use them
  • use the Block API to create, modify and
  • Extend Blocks with custom implementations

This guide is currently work-in-progress.

1 What are Aloha Blocks?

Aloha Blocks (Blocks) are non-editable areas of a website, which have some properties being editable through the Aloha user interface. Blocks can appear inside editables or outside editables, both inside inline elements and inside block-level elements.

Blocks themselves can contain editables and other blocks.

Some use cases for blocks include:

  • Displaying a vCard of a person from an address book.
  • Displaying product prices in continuous text. Here, the user should not be able to edit the prices.
  • Provide “templates” like a two-column block
  • TODO: add more use-cases

Blocks are not fully implemented yet. See TODO LINK TO WIKI for the current roadmap.

2 Enabling the Block Plugin

3 Creating Blocks

Aloha BLocks is implemented as a plugin called block, which is part of the common bundle.

Thus, in order to use blocks, you need to load the common/block and common/contenthandler plugin (Blocks interact with the contenthandler plugin).

After the plugin is loaded, you can create blocks.

3.1 Using jQuery


jQuery('.some-selector').alohaBlock();

3.2 Using Configuration

4 Interacting with Blocks

  • Getting “Block” instance (BlockManager.get or so…)
  • attr(…) explained

5 APIs and Extension Points

  • Writing custom Blocks
  • Writing custom Editors

6 Writing your own Block

7 Internals

8 Future Work

9 Changelog