Skip to content

Aloha blocks glossary

Jotschi edited this page Nov 10, 2011 · 3 revisions

Here, the most important terms related to block handling are defined.

Table of Contents

Aloha Block (short form: Block)

Main Defininition:

  • are non-editable elements on a website, which have some attributes being manipulated by the end user through the Aloha interface.
  • can occur inside Editables, but also outside Editables
  • can contain nested Editables
  • are rendered by a Block Renderer
  • content of the block unknown to the Block Plugin or Aloha Core
External API:
  • A block has Properties as key-value pairs
Restrictions:
  • not possible to nest blocks directly inside blocks

Block Plugin

  • Aloha Plugin which implements the Block functionality

Block Renderer

  • Object responsible for rendering a block.
  • Follows Command Design Pattern
  • is implemented by the user
  • Example: calls backend service via AJAX

Block Attributes

Examples: Simple for an address
{ 
name: Haymo
Phone: 12345
}
internally serialized as
<div data-name="Haymo" data-phone="12345" />

Storing a internal ID for/from a backend service

{ 
about: 323345 
}
internally serialized as
<div about="323345"  />

Edge case: having an inline HTML template

{
template: &lt;p class="tip {tip-type}"&gt;{tip-content}&lt;/p&gt;
tip-type: warning
tip-content: You are breaking the system!
}

internally serialized as

<div data-template="&amp;lt;p class=&amp;quot;tip {tip-type}&amp;quot;&amp;gt;{tip-content}&amp;lt;/p&amp;gt;" data-tip-type="warning" data-tip-content="You are breaking the system!" />

This is according to the XML / HTML specs

Editable

  • An element being content-editable AND controlled by Aloha.