QuestionQ14

Given a scenario, identify how to implement custom components and templates

A developer must create a new Title component. The requirements are:

  1. The layout must match the Title Core Component.
  2. The text property must use the page title as a prefix (for example, Page Title - <component text>).
  3. The component must be reusable.

Which approach is recommended?

Explanation

A site-specific proxy component inherits the Title Core Component through sling:resourceSuperType, preserving its layout while making the component reusable. A custom Sling Model can delegate to the inherited Title model and override the text value to prepend the current page title, without rewriting the Core Component or its template.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!