如何循环一个"多个字符串"来自ISML模板中的ProductBO对象?

时间:2017-02-14 12:00:04

标签: intershop isml

如何从ProductBO对象循环多个字符串?这样做的最佳方式是什么?

1 个答案:

答案 0 :(得分:1)

只要您知道属性的名称,就可以在ISML中的ProductBO上使用以下方法:

public AttributeValue getAttributeValue(String aName);

店面应用程序附带一个方便但不是非常灵活的模块,能够显示AV-s。它也适用于多个属性。模块的名称为ISCustomAttribute

样本用法:

<isCustomAttribute 
    attributelabel="#AttributeDescriptor:DisplayName#" 
    attributevalue="#ProductBO:AttributeValue(AttributeDescriptor:ID)#" 
    attributeseparator=",&nbsp;">

如果你使用这个模块,那将是最好的。你可能会看到它在行动。自定义ProductBO属性打印在店面的产品详细信息页面上,如下图所示(@see DetailsTab.isml):

enter image description here

如果这不适合,则必须将attribs检索为可迭代的东西。我认为最适合的方式是使用BO扩展BusinessObjectAttributes。您可以从中检索名称BusinessObjectAttribute并循环显示其值。

<isloop iterator="BusinessObjectAttribute:Value" alias="AValue" counter="counter">
    <!--- Do something gorgeous here --->
</isloop>