我希望能够读取我在对话框中设置的值并在 Sightly 中使用它来控制显示的代码部分。当我尝试使用下面的代码时,我收到此错误“操作数不是同一类型:仅支持数字比较”。我尝试了很多不同的修复程序,但没有发现任何有效的方法或任何文档。context = 'number' 不是正确的语法,还是我必须添加其他内容?
在对话框中
<number
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
fieldLabel="Select Amount of Delivery Options"
name="./number"
value = "4" >
<items jcr:primaryType="nt:unstructured">
<four
jcr:primaryType="nt:unstructured"
text="Four"
value= "4" />
<three
jcr:primaryType="nt:unstructured"
text="Three"
value= "3" />
<two
jcr:primaryType="nt:unstructured"
text="Two"
value= "2" />
<one
jcr:primaryType="nt:unstructured"
text="One"
value= "1" />
</items> </number>
在 HTL 中
<sly data-sly-test="${properties.podnumber @ context = 'number' >= 1}">