adobe / htl-spec

HTML Template Language Specification
Apache License 2.0
280 stars 146 forks source link

List and repeat blocks scope description issue #76

Closed karollewandowski closed 5 years ago

karollewandowski commented 5 years ago

The data-sly-list's block scope description can be misleading. It says:

Scope: The identifier set by the data-sly-list block element is available only in the element's scope. The identifier will override other identifiers with the same name available in the scope, however their values will be restored once outside of the element's scope.

It is not available exactly in element's scope, but only in element's content scope. eg:

<div data-sly-list.article="${category.articles}" 
     data-price="${article.price}"> <!-- error: article is unavailable here -->
  ${article.title}  <!-- correct: article is available here -->
</div>

Regarding data-sly-repeat, its scope's description is copied together with data-sly-list block name.

Scope: The identifier set by the data-sly-list block element is available only in the element's scope. The identifier will override other identifiers with the same name available in the scope, however their values will be restored once outside of the element's scope.

Besides that copy-paste issue description is correct.

raducotescu commented 5 years ago

Fixed in 662da77.