Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM: passing properties to sightly component from sling model inside HTML

Avatar

Level 1

Hi All,

We have a requirement wherein we need to create a template dynamically using the sling model response.

The challenge here is we have got some common components that we want to use for building up our template.

Is there a way that I can set the common components properties using slightly.

Any help is appreciated.

Regards

Anooj

1 Accepted Solution

Avatar

Correct answer by
Level 3

Are you talking about creating editable templates dynamically? It sounds like it from "create a template dynamically using the sling model response"

The best practice is to create an Editable Template (or more), create AEM Components using Sling Models, then in your Editable Template(s) - you set the policy the drives which components are allowed to be used in that given template.

Sling Models are used to create a given component - not Editable Templates.

You should follow the WEEKEND tutorial that shows you best practice on how to work with AEM technology:

WKND Tutorial Overview

This will guide you through how to properly use Editable Templates, components, Sling Models, etc.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

Are you talking about creating editable templates dynamically? It sounds like it from "create a template dynamically using the sling model response"

The best practice is to create an Editable Template (or more), create AEM Components using Sling Models, then in your Editable Template(s) - you set the policy the drives which components are allowed to be used in that given template.

Sling Models are used to create a given component - not Editable Templates.

You should follow the WEEKEND tutorial that shows you best practice on how to work with AEM technology:

WKND Tutorial Overview

This will guide you through how to properly use Editable Templates, components, Sling Models, etc.