New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E134 Exam - Topic 2 Question 52 Discussion

Actual exam question for Adobe's AD0-E134 exam
Question #: 52
Topic #: 2
[All AD0-E134 Questions]

A new component called Page Headline needs to be implemented. The only difference to the title component delivered by Adobe's WCM core components is that the text needs to be taken from the current page title instead of jcr.title.

How should a developer implement this request?

A)

1. Create custom component

2. Implement Sling Modal as follows

B)

1. Create proxy component from the core title component

2. Implement sling Model as follows

C)

1. Create proxy component from the core title component

2. Implement Sling Model as follows

Show Suggested Answer Hide Answer
Suggested Answer: C

To implement a new component called 'Page Headline' which takes the text from the current page title instead of jcr:title, you should create a proxy component from the core title component and implement a Sling Model accordingly. Option C demonstrates the correct approach to achieve this functionality.

Here is a detailed explanation of Option C:

Create Proxy Component:

Create a new component in your project that will act as a proxy to the core title component. This involves creating a new component node in the repository that inherits from the core title component.

Example path: /apps/myproject/components/pageHeadline with sling:resourceSuperType set to core/wcm/components/title/v2/title.

Implement Sling Model:

Implement a Sling Model that adapts from SlingHttpServletRequest and Title.class, ensuring it overrides the text fetching logic to retrieve the title from the current page's title.

The model will use @ScriptVariable to inject the current page and @Self to access the core title component's logic.

@Model(adaptables = SlingHttpServletRequest.class, adapters = Title.class, resourceType = 'myproject/components/pageHeadline')

public class PageHeadline implements Title {

@ScriptVariable

private Page currentPage;

@Self @Via(type = ResourceSuperType.class)

private Title title;

@Override

public String getText() {

return currentPage.getTitle();

}

@Override

public String getType() {

return title.getType();

}

}

@Model Annotation: Specifies that this class is a Sling Model and adapts from SlingHttpServletRequest. It is also an adapter for Title.class and applies to the myproject/components/pageHeadline resource type.

@ScriptVariable: Injects the current Page object, which allows access to the current page's properties.

@Self @Via(type = ResourceSuperType.class): Injects the core title component, allowing the reuse of existing logic.

getText() Method: Overrides the getText() method to return the title from the current page instead of the jcr:title.

getType() Method: Delegates to the core title component's getType() method to maintain existing functionality.

This approach leverages the power of Sling Models and the core components to extend functionality while keeping the implementation clean and maintainable.


Adobe Experience Manager - Core Components

Sling Models Documentation

Contribute your Thoughts:

0/2000 characters
Carlota
2 months ago
Surprised there's no mention of caching here!
upvoted 0 times
...
Kristine
2 months ago
I agree with B, it’s a solid approach.
upvoted 0 times
...
Lauran
2 months ago
Wait, can we really just use the core component like that?
upvoted 0 times
...
Lenita
2 months ago
Option B seems like the best choice.
upvoted 0 times
...
Val
3 months ago
I think A is more straightforward.
upvoted 0 times
...
Lauran
3 months ago
I feel like implementing a Sling Model is crucial here, but I can't remember if we need to create a completely new component or just extend the existing one.
upvoted 0 times
...
Toi
3 months ago
I’m a bit confused about the differences between options B and C. They both mention proxy components, but I can't recall what the specific implementation details were.
upvoted 0 times
...
Trina
4 months ago
I remember practicing a similar question where we had to modify a core component. I think option B might be the right choice since it suggests creating a proxy component.
upvoted 0 times
...
Lino
4 months ago
I think we should create a custom component for the Page Headline, but I'm not entirely sure if that's the best approach.
upvoted 0 times
...
Emerson
4 months ago
This is a pretty straightforward task, in my opinion. I'd go with Option B - create a proxy component and then implement the Sling Model as shown. Seems like the most efficient way to get the job done.
upvoted 0 times
...
Amina
4 months ago
I think I'd start by creating a proxy component from the core title component, as suggested in Options B and C. That way, I can easily override the behavior to use the current page title instead of jcr.title. The Sling Model implementation in Option C looks straightforward, so I'd probably go with that.
upvoted 0 times
...
Glory
4 months ago
Option C looks like the way to go here. Implementing the Sling Model as shown in the images seems like the most direct solution to get the page title instead of the jcr.title.
upvoted 0 times
...
Cherrie
5 months ago
Hmm, I'm a bit confused by the different options here. I'm not sure if creating a custom component or using a proxy component is the better approach. I'll need to review the details more carefully before deciding.
upvoted 0 times
...
Kelvin
5 months ago
This seems like a straightforward implementation task. I'd probably go with Option B - creating a proxy component from the core title component and then implementing the Sling Model as shown in the example.
upvoted 0 times
...
Corinne
5 months ago
I disagree, I believe creating a proxy component from the core title component as in Option B is a better approach.
upvoted 0 times
...
Chantay
5 months ago
Option C looks the most straightforward. Creating a proxy component and using the Sling Model to get the page title seems like the way to go.
upvoted 0 times
Harrison
1 month ago
Definitely the most efficient approach!
upvoted 0 times
...
Micaela
2 months ago
Proxy components are always a good choice.
upvoted 0 times
...
Leeann
2 months ago
I agree, Option C seems clean.
upvoted 0 times
...
Dona
3 months ago
Sling Model makes it easier to manage data.
upvoted 0 times
...
...
Paola
5 months ago
I think the developer should create a custom component as in Option A.
upvoted 0 times
...

Save Cancel