adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

Explain how list item renditions can be added #46

Closed henrykuijpers closed 6 years ago

henrykuijpers commented 7 years ago

The old foundation list component had the option of configuring list item renditions ("displayAs"-property).

The core list component doesn't have that option, so I assume this is something that needs to be added by a developer. It would however be good to document the best practices around implementing this feature.

I can imagine overwriting the "item.html" and putting in some logic to render the list items differently according to a dialog setting, or even according to the list item (Page) that is rendered.

gabrielwalt commented 6 years ago

+1 this needs to be documented

henrykuijpers commented 6 years ago

I think we actually need something a bit more complex: It would be nice if we can do something like this:

  1. Add list item rendition by defining sub components(?) or similar
  2. List the sub components in the dialog, to allow the author to select the list item rendition to be used
  3. Have the sub component contain an additional dialog, to let the author configure the specifics for that list item rendition (so that we can keep the original List component generic)
gabrielwalt commented 6 years ago

Interesting, thank you @henrykuijpers for the feedback, we'll review it next week. But I'd like to push the discussion a bit to better understand your needs.

Currently, the item can be configured to some extent through the dialog, and if more is needed, a developer must extend the core list component to customize the items, and potentially also the dialog to configure the specifics for that item rendition. In case very different renditions are needed that go beyond what can be configured in the dialog, the developer can create multiple components with the different item renditions, meaning that page authors then have different list components to choose from on their pages.

What do you think is missing or not ideal with that model? What is the benefit for the author to have a "displayAs"-property in their list component vs having different list components to choose from on the pages?

henrykuijpers commented 6 years ago

I (hopefully) answered this question cleary in: https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/issues/57

I do agree that having multiple specific list-components is also a possibility. I think it's a tradeoff between having 13 list components (or actually less, since some will probably apply to specific templates) vs having 1 list with 13 options (and thus one additional step for the content author).

gabrielwalt commented 6 years ago

Now that we additionally have the style system, I think that we have a quite flexible model to provide variations for the list items too. Therefore closing the issue.