Component Title | Teaser |
Description | Teaser allows the grouping of an image, title and description for promoting and linking to site content sections. One or more actions can also be defined. |
Features |
|
Location | /apps/ehi-core/aem65/components/content/teaser/v1/teaser |
sling:resourceSuperType | core/wcm/components/teaser/v1/teaser |
Supported AEM Versions | 6.5 |
Editing Mode | inPlaceEdit |
Component Group | Cheerios Experience |
Use Object | The Teaser component uses the com.adobe.cq.wcm.core.components.models.Teaser Sling model as its Use-object. |
BLOCK cmp-teaser
ELEMENT cmp-teaser__image
ELEMENT cmp-teaser__content
ELEMENT cmp-teaser__title
ELEMENT cmp-teaser__title-link
ELEMENT cmp-teaser__description
ELEMENT cmp-teaser__action-container
ELEMENT cmp-teaser__action-link
When extending the Teaser component by using sling:resourceSuperType, developers need to define the imageDelegate property for the proxy component and point it to the designated Image component.
For example:
imageDelegate="core/wcm/components/image/v2/image"
Extending the components can be done in multiple ways depending on the needs of the brand component.
Use this approach if you do not have any required html markup changes or backend java changes. This will only update the title of the component, componentGroup and point to the resourceSuperType. Optionally can extend the description.
Use this approach if you need to update css classes or add data attributes and do not need to change the backend model, or potentially want to use a different model by retain all of the markup in the component-tmpl.html (Component Template) markup.
The component template is usually named component-tmpl.html this file contains the html markup. Update this file if you need to change the html structure of the component.
Use this approach if you need to change the Sling Model to update the backend logic.
Files that will need to be added when extending:
It is possible to extend more than just the component.html file, if necessary any file that is resourceSupertyped can be extend for example if something needs added to the dialog.
This gives us the flexibility to change our classes or add attributes easily. Say I want to add new javascript I can easily target a different data attribute to trigger my javascript.
The following configuration properties are used:
The following configuration properties are inherited from the image component:
The following properties are written to JCR for this Teaser component and are expected to be available as Resource properties:
Description of component being demoed.
- jcr:primaryType: nt:unstructured
- jcr:createdBy: E524Z2
- jcr:title: Title of Teaser
- fileReference: /content/dam/entegral/New-Auto-Safety-Technology-Leaves-Insurers-in-the-Dark-min.jpg
- actionsEnabled: false
- jcr:lastModifiedBy: E524Z2
- jcr:created:
- titleFromPage: false
- imageFromPage: true
- linkURL: /content/martech/component-library/teaser
- jcr:description: <p>Description of Teaser</p>
- jcr:lastModified:
- descriptionFromPage: false
- sling:resourceType: ehi-core/aem65/components/content/teaser/v1/teaser
- textIsRich: true