Aloha Editor

Aloha Editor Guides

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

Align Plugin

The Align Plugin allows you to align contents left, right, center, or justify the flow of text. You can also define vertical align options (top, middle and bottom) for table cells.

1 Configuration settings

The align plugin allows you to configure which of it’s buttons are available. Available options: 'right', 'left', 'center', 'justify' as well as 'top', 'middle', 'bottom' for table cells. Use an empty array to deactivate the plugin for an editable.

All editables with no special configuration will have the align options 'right', 'left', 'center', 'justify'. The align plugin for the editable with ID ‘one’ has the [ 'right', 'left' ] align buttons enabled. The plugin is deactivated for the editable with the ID ‘two’.

Editable denoted by ID ‘three’, has both horizontal and vertical alignment options.


	Aloha.settings.plugins = {
		align: {
			config: {
				alignment: ['right', 'left', 'center', 'justify'],
			},
			editables: {
				'#one': {
					alignment: [ 'right', 'left' ]
				},
				'#two': { 
					alignment: [ ]
				},
				'#three': { 
					alignment: [ 'left', 'right', 'top', 'middle', 'bottom' ]
				},
			}
		}
	};

2 Components

  • alignLeft – align selected text left
  • alignRight – align selected text right
  • alignCenter – center selected text
  • alignJustify – justify selected text
  • alignTop – align cell contents to the top
  • alignMiddle – align cell contents to the middle
  • alignBottom – align cell contents to the bottom