AEM · AEM 6 · Sightly

AEM | ACS – Generic List | Support Site Inheritance


Generic List is a feature (by ACS AEM Commons) allowing easy creation and management of lists of title/value pairs. These lists can be managed by content team and will be used in Component’s dialogs. So instead of hardcoding dropdown values in dialog, we can point to any generic list and this list will be configured and managed by editors.

In ACS’s Generic List, a dropdown will point to a specific list only. In multi site scenario, where same component will be used by multiple sites, but with different configuration, we need a more intelligent list which identify list for correct site and return site specific list.

Example: Consider a scenario where you have two sites: SiteA & SiteB and both sites share same component say Heading. Heading component has two attributes, a textfield & a dropdown to select heading style.

  • SiteA need following heading style: Paragraph, Heading 1 & Heading 2
  • SiteB need following heading style: Paragraph, Heading 1, Heading 2, Heading 3 & Heading 4

There are three options to achieve above requirements:

  1. Create a list of all possible options so that our component will get a masterlist with all options. Problem with this solution is that SiteA will get unwanted configuration values and might generate error if author select these unwanted values.
  2. Create two list (for each site), create two component (for each site), point each component with correct list. This solution sounds simple but we are maintaining two copy of same component. From maintainability prospective, we need to maintain multiple copy of same component.
  3. Create two list (for each site), Use one component to point list with some identifier to identify Current Site + List. By this solution, we have support any number of sites with same component. Each site can have different configuration (by different list).

Solution:

  1. We need to override Generic List template, as ACS List template is visible to “/etc/acs-commons/lists” path only. As we will be creating Site specific lists, we will follow following list hierarchy:
        |
        |-- etc
        |-------lists
        |------------ <site A>
        |--------------------- <List 1>
        |--------------------- <List 2>
        |--------------------- <List 3>
        |------------ <site B>
        |--------------------- <List 1>
        |--------------------- <List 2>
    

    Please see: ACS – Generic List | Extend Template for your site to create your Generic List template

  2. Create Service to Configure Site Specific Generic List
  3. Configure and generate Site Specific Generic list for Classic UI dialog
  4. Configure and generate Site Specific Generic list for Touch UI dailog

Source Code: Click here to download.

Advertisements

4 thoughts on “AEM | ACS – Generic List | Support Site Inheritance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s