Blocks

Blocks are pieces of content that can be reused and shared between websites, while being maintained in one place only. Typical types of content blocks are campaign teasers and banners, videos, news feeds and contact forms. Just like for pages, you can have different block types, such as an editorial block, or a form or page listing block.

Blocks are managed from the Blocks tab under the assets pane in Optimizely CMS, where you can create new blocks and organize them in folders. You can then use blocks by dragging them into the content area Where you can drag and drop pages and blocks, and create a block. (A link collection has a similar area for creating links.) of Optimizely CMS pages. You can manage block versions like other types of content, and blocks can also be personalized to be displayed for a selected visitor group Site visitors with something in common, such as age, geographic location, and so on. Used in the personalization feature of Optimizely CMS. (See Personalizing Content.).

Image: Blocks tab, context menu

Finding the block location

Use the search field at the top of the pane to enter search criteria and retrieve blocks. Clicking a search result will expand the folder where the block is located. To browse for blocks, click a folder to expand the folders and content beneath it.

If you have an already inserted a block in the rich-text editor and you want to find out where it is stored, select the block in the editor and a Go to block button is displayed. Click this button to open the block or hover over it to see where the block is stored.

Image: Go to Block button

Views when creating and editing blocks

Blocks can be created and edited in different types of views; either in the On-page editing Where you can edit selected properties for content in a WYSIWYG-like view. (See All properties editing view for comparison.) or All properties editing Where you access and edit all properties for content. (See On-page editing view for comparison.) views which both open the block in the main content area. They can also be edited in the Quick edit view The Quick edit view can be used when updating blocks. It lets you see all relevant block properties in one dialog box and you do not have to leave the page context. which opens the block in a pop-up dialog box.

Using the first option, On-page or All properties editing view, you can see all properties belonging to the block and you can drag and drop images from the assets pane and so on. Using the second option, Quick edit view, you can edit the block without leaving the current context and relevant properties are found in the same view (which properties you see depend on your site configuration). If no approval sequence has been set up for the block, you can also publish your changes directly from the Quick edit view.

Block editing in On-page/All properties editing view:   Block editing in Quick edit view:
Image: Block editing in on-page edit view/all properties view   Image: Block editing in quick edit view

Creating a block

You must have Create access rights to the global or site-specific folder under For All Sites/For This Site where you want to create a block, or to the current page when creating a block in the local For This Page folder.

Creating a block from the Blocks tab in the assets pane

When using this option, you can choose where to save the block in the block folder structure. If you save it under For All Sites or For This Site, the block is available for other pages on the website. If you save it under For This Page, it is only available for use on the current page. Creating a block from the assets pane will use the On-page or All properties editing views.

  1. Select the folder in the structure where you want create a block, and select New Block in the context menu, or click one of the New Block buttons.
    Image: Add New Block options
  2. Select the block type among those that are available, and provide a name for the block.
  3. Depending on the type of block, add content as appropriate.
  4. Publish the block immediately or schedule for publishing later. Unpublished blocks are not visible to visitors, and appear dimmed out in edit view when added to a content area.

    Image: Unpublished block

Creating a block directly from a content area

When using this option, the block is saved in the For This Page/For This Block folder for the selected page or block, which means that it is not available on any other pages on the website.

Image: Create block from content area

  1. Click Create a new block in the content area, from the On-page or the All properties editing view.
  2. Select the block type among those that are available and give the block a name.
  3. Depending on the type of block, add content as appropriate.
  4. Click Create. If there is an approval sequence set on the page or if you do not have publish rights, the block is created as a draft, otherwise it is immediately published.

Editing a block

Changes made to a block that is being used in content on the website affect all instances where the block is used.

You can edit blocks directly from the content area where it is being used, or from the Blocks tab in the assets pane.

  1. Select the desired block to edit. Select either Quick Edit from the context menu to open the block in Quick edit view, or Edit to open it in On-page or All properties editing view.
  2. Depending on the type of block, change the content as appropriate.

    If you want to rename the block, use the All properties editing view.

  3. Depending on which view you are using, as well as the system configuration and your access rights, you have the following options:
    • In Quick edit view, save the block to return to the page, or set the block to Ready for Review, Ready to Publish, or publish your changes immediately.
    • In On-page/All properties editing view, set the block to Ready for Review, Ready to Publish, or publish the block immediately. In these views, you can also schedule it for later publishing.

Using blocks in content

Blocks can only be added to content areas that support blocks. In edit view, select the desired block in the assets pane, and drag it into a content area of a page. A blue frame indicates where it is possible to add blocks on the page.

Image: Block in content

You can add several blocks to the same area. Drag the block above or beneath an existing block, and drop it when the separator appears. The blocks can be rearranged later. It is also possible to add blocks to a content area in the All properties editing view.

Image: Rearrange block order in edit view

Like blocks, pages from the page tree can also be dropped into a content area. Depending on how the page template is built, the content of the selected page is rendered in the content area.

Blocks can also be added to a rich-text editor area through drag and drop.

Image: Block, drag and drop

To remove a block from a content area, select Remove from the context menu.

You can personalize blocks to display targeted information to selected visitor groups, see Personalizing content. Personalized blocks are not displayed in the edit view. Select a content area to display personalized blocks.

You cannot link to blocks since they do not have a web address (URL). However, you can create links to other pages and media files if the block contains the rich-text editor (XHTML string property).

Arranging blocks in a content area

You can change the display order of blocks by rearranging them in the content area, through drag and drop, or by selecting Move up or Move down in the context menu.

Image: Block context menu

Displaying blocks in different styles

You can select display options for blocks on a page in different sizes and styles. The rendering of blocks needs to have built-in support for managing different widths, in order for the content to be properly displayed.

The following options are available:

  • Automatic. Select this option to display the block using an appropriate built-in style option selected by the system.
  • Manually. Select this option to display the block using the specific style option, such as Full, Wide, or Narrow presets for the specific context where the block is used.

Image: Block, display options

Moving, copying and removing blocks in folders

Moving, copying and removing a block works in a similar way as for pages by using the context menu. Since blocks and media files share the same folders, removing a folder from the tree structure affects all content within the folder. If any block or media within a folder is used on the website, you are notified about the usage before the content is moved to trash.

A block is no longer available on the website once it is moved to trash. You can see removed blocks by selecting View Trash from the context menu of the block gadget.

Versions, content languages and access rights for blocks

  • Versions for blocks are managed in the same way as for other types of content. When you update the properties for a block, a new version will be created, which will be listed in the versions gadget. See Publishing and managing versions.
  • Content languages for blocks are managed in the same way as for other types of content, see Translating content.
  • Access rights can be defined for creating and viewing blocks. This is done directly for a specific block in the All properties editing view, or for an entire block structure from the admin view. From code it is also possible to restrict the block types that can be added to a content area. See Setting access rights from edit view and Access rights.

See also Self-optimizing block.