Expand my Community achievements bar.

SOLVED

sling model

Avatar

Level 2

htl code to get link on a page injected by sling model .  provided below snapshot of my htl code,  I am doing right way?Screenshot (39).png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Dvaraka ,

 

What is the exact issue? Do you want to add an extension to your injected URL ? or URL itself is not getting injected? Could you please give us more clarity on this? and please share your sling model also.

 

One more thing why you are passing ${textmodel.customtextarea} in href? it should be ${textmodel.link}.

 

Thanks

View solution in original post

3 Replies

Avatar

Community Advisor

Hi,

 

Use @CONTEXT='html'  or uri for anchor tags

 

Screen Shot 2022-04-26 at 1.04.51 PM.png

Adds the html extension to a path.

<a href="${item.path @ extension = 'html'}">${item.name}</a>

For more information about context attributes, you can refer below link

https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/expression-language.html?la...

 

Avatar

Correct answer by
Community Advisor

Hi @Dvaraka ,

 

What is the exact issue? Do you want to add an extension to your injected URL ? or URL itself is not getting injected? Could you please give us more clarity on this? and please share your sling model also.

 

One more thing why you are passing ${textmodel.customtextarea} in href? it should be ${textmodel.link}.

 

Thanks

Avatar

Community Advisor

@Dvaraka As @MayurSatav mentioned , you are actually printing the wrong property in the link. Instead of ${textmodel.custometextarea} you should use the property name you have given to the link field .