QuestionQ20

Given a scenario, identify how to implement Sling Models and HTL

The following anchor tag does not resolve:

<a href =“item.path” >\{item.name\}</a>  

On further inspection, the developer sees that no .html is appended to the end of the URL. What might be a potential fix for this issue?

  • A <a href=“item.path@extension =' html'” >{item.name}</a>
  • B <a href=“item.path@context =' unsafe, fragment = item.name” >{item.name}</a>
  • C <a href=“item.path@append =' html'” >{item.name}</a>
  • D <a href=“item.path@context =' html'” >{item.name}</a>
Explanation

HTL’s URI-manipulation extension option adds or replaces a resource URL’s extension. Setting it to html generates a link ending in .html, allowing the resource URL to resolve using the HTML extension.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!