[Plone-IT] sort in base a data di pubblicazione

Vito Falco vitofalco a gmail.com
Lun 11 Gen 2010 17:28:23 UTC


Dimenticavo... il codice scritto ordina per l'ultimo pubblicato, mentre per
stamparlo

<div tal:define="oggetto python:presults[0]">
  <a tal:attributes="href oggetto/getPath">
    <b tal:content="oggetto/TItle" />
  </a>
</div>

Il giorno 11 gennaio 2010 18.25, Vito Falco <vitofalco a gmail.com> ha
scritto:

> "presults python:context.portal_catalog(portal_type='News
> Item', path='/test/avvisi/libri', sort_on='effective', sort_order='desc')"
>
> Vito
>
> Il giorno 11 gennaio 2010 18.19, Fabrizio Rota <fabrizio.rota a gmail.com>ha scritto:
>
>> Come è possibile modificare questo codice per un portlet custom
>>
>>
>>      <div  id="portlet_ultimo_libro_consigliato"
>>              tal:define="presults python:context.portal_catalog(portal_type='News Item',
>>
>>
>>                          path='/test/avvisi/libri')"
>>              tal:condition="presults">
>>                <tal:block define="pobj python:random.choice(presults).getObject()">
>>
>> perchè estragga non un "libro" a caso ma solo l'ultimo pubblicato?
>> Ho tentato con
>>
>>                <tal:block define="pobj python:presults[len(presults)-1].getObject()">
>>
>> ma sbuca l'ultimo che ho CREATO, e non quello con la DATA DI PUBBLICAZIONE
>> più recente.
>> Non uso un normale portlet "collezione" perchè mi restituisce solo il link
>> al libro che voglio mentre io col "mio" metodo pubblico la scheda stessa.
>>
>> grazie in anticipo
>> --
>> Faber
>> --------------------
>> "Life is what happens to you while you're busy making other plans" - J.
>> Lennon
>>
>> _______________________________________________
>> Plone-IT mailing list
>> Plone-IT a lists.plone.org
>> http://lists.plone.org/mailman/listinfo/plone-it
>> http://www.nabble.com/Plone---Italy-f21728.html
>>
>
>
>
> --
> "Design is the method of putting form and content together. Design, just as
> art, has multiple definitions; there is no single definition. Design can be
> art. Design can be aesthetics. Design is so simple, that's why it is so
> complicated." by Paul Rand
>



-- 
"Design is the method of putting form and content together. Design, just as
art, has multiple definitions; there is no single definition. Design can be
art. Design can be aesthetics. Design is so simple, that's why it is so
complicated." by Paul Rand
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20100111/d112648f/attachment.html>


Maggiori informazioni sulla lista Plone-IT