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
BedrockMission!

Learn More

View all

Sign in to view all badges

Accessing screens display properties in custom component

Avatar

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Karl515
Level 4

09-05-2019

Can we access screens display properties in my custom component using slightly?

1749337_pastedImage_0.png

1749365_pastedImage_1.png

1749366_pastedImage_2.png

components are in channels so they are separately

1749367_pastedImage_3.png

How can i access that area? Thanks.

AEM 6.4.4

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

09-05-2019

you can access any resource and there properties in sightly using JS use API or Java sling Model.

example.

@Model(adaptables = { Resource.class, SlingHttpServletRequest.class })

public class ImageMetadataModel {

@Inject

@Optional

private String screenPath;

@SlingObject

private ResourceResolver resourceResolver;

public String getProperty () {

Resource resource = resourceResolver.getResource(screenPath);

String property = “”;

if (resource != null) {

Page page = resource.adaptTo(Page.class);

property = page.getTitle();

}

return property;

}

}

Avatar

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Karl515
Level 4

13-05-2019

Thanks Arun for taking your time to reply.

I know I can access jcr properties thru JCR API. But what I am trying to solve is access screens location properties thru custom component.

     - create custom component.(should display location property)

     - add component in sequence-channel.

     - assign sequence-channel to a screens location display.

     - get the location properties thru custom component.(must be dynamic since the custom component can be assigned in any location display.)

Hope I made my self understandable. If not Please tell me.

Avatar

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Karl515
Level 4

13-05-2019

In other words. I'm trying to know the location in which my custom component is added.

Thanks!

Avatar

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
Karl515
Level 4

Likes

14 likes

Total Posts

157 posts

Correct Reply

11 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Karl515
Level 4

14-05-2019

Like a Global Object.

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

14-05-2019

you can try with pageProperties object HTL Global Objects