Web中心站点 - 如何按属性值订购资产组资产列表?

时间:2016-02-11 11:44:58

标签: webcenter webcenter-sites fatwire

我有一个包含属性列表的资产(Modal_MKT)。其中一个属性是order(int value)。我想获得按订单字段排序的WCS中创建的Modal_MKT元素列表。

我让我的代码,这循环遍历所有正确的模态,但最终列表不是由我的" order"字段。

<%-- Creamos el objeto donde añadir los criterios de búsquedas --%>  
<searchstate:create name="ssModales"/>  


<%-- Si estamos en la versión móvil, sólo nos interesan las modales creadas para móvil, sino las de escritorio --%>  
<ics:if condition='<%="Touch".equalsIgnoreCase(ics.GetVar("outputdevice"))%>'>  
  <ics:then>  
  <searchstate:addsimplelikeconstraint name="ssModales" typename="Content_Attribute" attribute="showMobile" value="Si" immediateonly="true"/>  
  </ics:then>  
  <ics:else>  
  <searchstate:addsimplelikeconstraint name="ssModales" typename="Content_Attribute" attribute="showDesktop" value="Si" immediateonly="true"/>  
  </ics:else>  
</ics:if>  


<%-- Cargamos conjunto de assets de las modales del sistema --%>  
<assetset:setsearchedassets name="asModales" constraint="ssModales" assettypes="Modal_MKT" site='<%= ics.GetVar("siteId") %>'/>  


<%-- Obtenemos los valores que queramos ordenados como queramos --%>  
<assetset:getmultiplevalues name="asModales" prefix="vList" immediateonly="true" byasset="true">  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="order" direction="descending" />  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="modalTitle" direction="none" />  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="modalStartDate" direction="none" />  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="modalEndDate" direction="none" />  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="showMobile" direction="none" />  
    <assetset:sortlistentry attributetypename="Content_Attribute" attributename="showDesktop" direction="none" />  
</assetset:getmultiplevalues>  


<%-- Pasamos el conjunto de assets a una lista y la recorremos --%>  
<assetset:getassetlist name="asModales" listvarname="aslist"/>  


<ics:listloop listname="aslist">  
    <ics:listget listname="aslist" fieldname="assetid" output="theid"/>  
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":modalTitle"%>' fieldname="value" output="title"/>   
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":order"%>' fieldname="value" output="order" />  
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":modalStartDate"%>' fieldname="value" output="modalStartDate" />  
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":modalEndDate"%>' fieldname="value" output="modalEndDate" />  
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":showMobile"%>' fieldname="value" output="showMobile" />  
    <ics:listget listname='<%="vList:"+ics.GetVar("theid")+":showDesktop"%>' fieldname="value" output="showDesktop" />  

    <br/>  

    <%= ics.GetVar("theid") %> -   
    <%= ics.GetVar("title") %> -   
    <%= ics.GetVar("modalStartDate") %> -   
    <%= ics.GetVar("modalEndDate") %> -   
    <%= ("Si".equals(ics.GetVar("showMobile")))? "Movil:Si" : "Movil:No" %> -   
    <%= ("Si".equals(ics.GetVar("showDesktop")))? "Desktop:Si" : "Desktop:No" %> -   
    <%= (Utilities.goodString(ics.GetVar("order")))? ics.GetVar("order") : "0" %>   
</ics:listloop>  

此列出Modal_MKT内容中的所有资源,但没有按我的属性

排序

0 个答案:

没有答案