1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      i18n:domain="plone">

<body>

<div metal:define-macro="base_portlet"
     tal:define="results here/getCatalogDestaques.py"
     tal:condition="results">

    <div class="titulo-destaques">
    <a href="#" title="destaques"
    tal:attributes="href string:${here/absolute_url}/;"
  >Destaques</a>
  </div>

    <div class="portlet_destaques">
    <tal:block tal:repeat="item results">
      <div class="destaque-tile"
        tal:attributes="class python:test(repeat['obj'].odd(),
                                 'destaque-tile esquerda',
                                 'destaque-tile direita')">

      <tal:block tal:define="result_url item/getURL; 
                         url string:$result_url/view;">

        <a href="#" tal:attributes="href url;  title item/Description" >
        <p class= "destaques-title" tal:content="python:item.Title or item.getId" />
          <p class= "destaques-descricao" tal:content="python:item.Description"/>
          </a>
  </div>

      </tal:block>
  </tal:block>
  </div>
</div>
</body>

</html>



---------------------------------------------------------
script

parameters=

1
2
3
lista-fixos = []
lista-normal=[]
lista-final=[]

lista de destaques fixos,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
lista-fixos = context.portal_catalog.searchResults(
        Subject = { "query": ["Destaques", "Destaques-fixo"],
                     "operator": "and" 
                     }
)
lista-normal = context.portal_catalog.searchResults(
    Subject = { "query": ["Destaques"]}

)

lista-fixos.append(lista-normal)

for e in lista-fixos:
       if e not in lista-final:
           lista-final.append(e)

# enter your query into the kw dictionary
return lista-final