I am working on a component that uses a Sling Model and HTL, but the CTA link is not rendering on the page. Below is the code
Sling Model
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class BannerModel {
@ValueMapValue
private String title;
@ValueMapValue
private String ctaText;
@ValueMapValue
private String ctaLink;
public String getTitle() {
return title;
}
public String getCtaText() {
return ctaText;
}
public String getCtaLink() {
return ctaLink;
}
}
banner.html
<div data-sly-use.model="com.techinnovia.core.models.BannerModel">
<h1>${model.title}</h1>
<a href="${model.ctaLink}">${model.ctaText}</a>
</div>
The component renders title and ctaText fine, but ctaLink always shows as null. No errors in logs.
What could be wrong here?