Important

You are browsing the documentation for version 1.6 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Available in OroCommerce

Content Blocks

Content Blocks are the foundation of your site, and they can help create a custom layout. In Oro applications, you can modify the existing content blocks, or create your own.

Note

Creating a new content block requires developers’ assistance. As a sample, use Home Page Slider content block, the code and configuration in the yaml file that helps embed it into the website homepage.

To edit a defined content block:

  1. Navigate to Marketing > Content Blocks in the main menu.

  2. Click at the end of the content block you wish to edit, and click to open the selected block for editing.

    The actions available to a content block from the grid
  3. In the General tab, you can amend the following fields:

    • Owner — The owner of the content block.
    • Alias — The unique identifier that can be used in the layout to render a block.
    • Titles — Localized block title.

    Note

    To enable/disable the content block, select/clear the Enabled check box.

  1. In the Restrictions section, you can specify or edit visibility restrictions for the content block.

By default, the content block is displayed for any localization, on any website, and for any customer. To make OroCommerce apply a content block to the storefront only for the particular combination of these facts, create a restriction by selecting all or some of the following: target localization, website, customer, or customer group.

Note

Only one field must be chosen for customers at a time, either a customer group or a customer.

Set the necessary restrictions for the content block
  1. In the Content Variants section, you can add (click Add Content) or remove (click ) various content variants for the content block. Once you add more than one content variant, you will have to apply restrictions to any non-default variants. These restrictions help you set up the conditions where content should override the default option.

    Warning

    Never leave the restrictions for non-default variant empty. This may cause unexpected priority collision between the default and non-default variant.

    Note

    Only one field must be chosen for customers at a time, either a customer group and a customer.

For instance, you can set the content block to have a specific text displayed for Non-authenticated Visitors. For that:

  1. Set visibility restrictions to Non-authenticated Visitors in Restrictions > Customer Groups.
  2. Add a new content variant by clicking Add Content in the Content Variant section.
  3. Enter text.

To translate the content block (e.g., the homepage slider), restrict it to the required localization(s).

For instance, to translate the homepage slider into German:

  1. Set the visibility restriction to German in Restrictions > Localization.

  2. Edit the default variant to include Germany-specific content, or add another content variant by clicking +Add.

    Translating the landing page content block
  3. Click Save and Close

  4. Once switched to the German localization, the home page slider displays the new content.

    Translated home page slider in the storefront