Hola a todos, esta es la solución:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="here/main_template/macros/master"
i18n:domain="plone">
<body>
<div metal:fill-slot="main">
<metal:main-macro define-macro="main">
<metal:listingmacro define-macro="listing">
<tal:foldercontents define="contentFilter
contentFilter|request/contentFilter|nothing;
limit_display
limit_display|request/limit_display|nothing;
more_url
more_url|request/more_url|string:folder_contents;
contentsMethod
python:test(here.portal_type=='Topic',
here.queryCatalog,
here.getFolderContents);
folderContents
python:here.getFolderContents(contentFilter =
{'portal_type' : ['Topic']}, batch =
True);
use_view_action
site_properties/typesUseViewActionInListings;
over_limit python: limit_display and
len(folderContents) > limit_display;
folderContents python: (over_limit and
folderContents[:limit_display])
or
folderContents;
batch folderContents">
<tal:listing condition="folderContents">
<div tal:repeat="item folderContents">
<tal:block tal:define="item_url
item/getURL|item/absolute_url;
item_title_or_id
item/pretty_title_or_id;
item_object item/getObject;
">
<h1>
<span style="margin: 0;
padding: 0;
border: none !important;
text-decoration: none;"
tal:condition="not: isAnon">
<a href="/view" tal:define="url
python:(item_url+'/criterion_edit_form')" tal:attributes="href url" >
<img src="" alt="" title=""
tal:attributes="src
string:$portal_url/pencil_icon.gif;
alt
python:('editar Criterio ' + item_title_or_id);
title
python:('editar Criterio ' +item_title_or_id)
" />
</a>
</span>
<span class="documentFirstHeading"
metal:define-macro="listitem"
tal:content="item_title_or_id"/>
</h1>
<div class="documentByLine" tal:define="creator
item_object/Creator;">
<tal:name tal:condition="creator"
tal:define="author
python:mtool.getMemberInfo(creator)">
<span i18n:translate="label_by_author">
by
<a href="#"
tal:attributes="href
string:${portal_url}/author/${creator}"
tal:content="python:author and
author['fullname'] or creator"
tal:omit-tag="not:author"
i18n:name="author">
Edgard Aviles
</a>
</span>
—
</tal:name>
<span i18n:translate="box_last_modified">
last modified
</span>
<span
tal:replace="python:item_object.toLocalizedTime(item_object.ModificationDate(),long_format=1)">
August 16, 2001 at 23:35:59
</span>
</div>
<div class="plain">
<tal:itemscolection tal:define="items_catalog
item_object/queryCatalog" >
<tal:object repeat="item_colection
items_catalog">
<div tal:define=" item_URL
item_colection/getURL|item/absolute_url;
item_id
item_colection/getId|item/id;
item_title
item_colection/pretty_title_or_id;
item_description
item_colection/Description;
item_type
item_colection/portal_type;
item_type_title
item_colection/Type;
item_type_class
python: 'contenttype-' + putils.normalizeString(item_type);
item_wf_state
item/review_state|python: wtool.getInfoFor(item_colection, 'review_state',
'');
item_wf_state_class
python:'state-' + putils.normalizeString(item_wf_state);
item_modified
item_colection/ModificationDate;
item_created
item_colection/CreationDate;
item_creator
item_colection/Creator;
item_effective
item_colection/effective/ISO|item/EffectiveDate|nothing;
item_start
item_colection/start/ISO|item/StartDate|nothing;
item_end
item_colection/end/ISO|item/EndDate|nothing;
object
item_colection/getObject;
"
tal:attributes="class
string:tileItem visualIEFloatFix vevent ${item_type_class}">
<a href="#"
tal:attributes="href
python:test(item_type in use_view_action, item_URL+'/view', item_URL);">
<img src="" alt=""
tal:condition="exists:object/image_thumb"
tal:replace="structure python: path('nocall:object/tag')(scale='thumb',
css_class='tileImage')" />
</a>
<h2 class="tileHeadline">
<a href="#"
class="summary url"
tal:attributes="href
python:test(item_type in use_view_action, item_URL+'/view', item_URL);"
tal:content="item_title">
Item Title
</a>
</h2>
<div id="effectiveDate">
<span
tal:content="item_effective"> Fecha efectiva</span>
</div>
<div class="documentByLine"
tal:condition="python: site_properties.allowAnonymousViewAbout or not
isAnon">
<tal:event condition="python:
item_type == 'Event'">
<span tal:condition="python:
item_type == 'Event' and item.location"
i18n:translate="label_event_byline">
(<span
tal:content="string:${item/location}"
class="location"
i18n:name="location">Oslo</span>, from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,long_format=1)"
i18n:name="end">to date</abbr>)
</span>
<span tal:condition="python:
item_type == 'Event' and not item.location"
i18n:translate="label_event_byline_without_location">
(from
<abbr class="dtstart"
tal:attributes="title python:item_start"
tal:content="python:toLocalizedTime(item_start,long_format=1)"
i18n:name="start">from date</abbr> to
<abbr class="dtend"
tal:attributes="title python:item_end"
tal:content="python:toLocalizedTime(item_end,long_format=1)"
i18n:name="end">to date</abbr>)
</span>
</tal:event>
<tal:newsitem condition="python:
item_type == 'News Item'">
<tal:name
tal:condition="item_creator"
tal:define="author
python:mtool.getMemberInfo(item_creator)">
<span
i18n:translate="label_by_author">
by
<a href="#"
tal:attributes="href
string:${context/@@plone_portal_state/navigation_root_url}/author/${item_creator}"
tal:content="python:author and author['fullname'] or item_creator"
tal:omit-tag="not:author"
i18n:name="author">
Bob Dobalina
</a>
</span>
</tal:name>
—
<span
tal:replace="python:toLocalizedTime(item_modified,long_format=1)">
August 16, 2001 at 23:35:59
</span>
</tal:newsitem>
</div>
<p class="tileBody">
<span tal:omit-tag=""
tal:condition="not:item_description">
</span>
<span class="description"
tal:content="item_description">
description
</span>
</p>
<p class="tileFooter">
<a href=""
tal:attributes="href
python:test(item_type in use_view_action, item_URL+'/view', item_URL);"
i18n:translate="read_more">
Read More…
</a>
</p>
</div>
</tal:object>
</tal:itemscolection>
</div>
<div class="visualClear"><!-- --></div>
</tal:block>
</div>
<!-- Navigation -->
<div metal:use-macro="here/batch_macros/macros/navigation" />
</tal:listing>
<div metal:use-macro="here/document_actions/macros/document_actions">
Document actions (print, sendto etc)
</div>
<metal:empty metal:define-slot="no_items_in_listing">
<p class="discreet"
tal:condition="not: folderContents"
i18n:translate="description_no_items_in_folder">
There are currently no items in this folder.
</p>
</metal:empty>
</tal:foldercontents>
</metal:listingmacro>
</metal:main-macro>
</div>
</body>
</html>
Este código lo que hace es buscar primeramente todas las colecciones en la
raiz del portal, si quieres podes limitar los resultados
con
python:here.getFolderContents(contentFilter ={'portal_type' : ['Topic']},
batch = True,b_zise=LIMITE_RESULTADO);
una vez obtenido las colecciones asignas a una variable los brains retornado
por catalogo con el metodo queryCatalog
tal:define="items item_object/queryCatalog"
Gracias Marcos por ese tip :)
luego lo recorres el objeto con repeat y mostrar sus propiedades como
titulo, descripcion, creador, fecha de creacion, etc..
Podes arreglar la presentación con un poco de css para que se muestres en
tres columnas o como querras, sin tener
que instalar productos como contentWellPortlets o collage si queres mostrar
simplemente resultados de una coleccion.
El resultado depende de la coleccion, entonces podes cambiar los criterios y
los limites de la coleccion manualmente desde dicha coleccion, asi tenes
mayor flexibilidad para cambiar el resultado que queres mostrar.
espero que alguien le sirva como a mi :D
Saludos
_______________________________________________
Plone-ConoSur mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-conosur