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

Fabrizio Rota fabrizio.rota a gmail.com
Mar 12 Gen 2010 17:04:45 UTC


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

> Ok, ho capito.
> Io a questo punto farei un portlet ad-hoc per gestire questa esigenza. Così
> nella .py del portlet fai ricerca in AdvancedQuery e cerchi quello che vuoi.
>
> Vito
>

Eh..... ne passerà del tempo prima che io riesca ad arrivare lì......
Nel frattempo non stancarti di sentirmi ogni tanto......


grazie

faber

>
> Il giorno 12 gennaio 2010 15.04, Fabrizio Rota <fabrizio.rota a gmail.com>ha scritto:
>
>
>>
>> Il giorno 12 gennaio 2010 14.38, Vito Falco <vitofalco a gmail.com> ha
>> scritto:
>>
>>> Ciao,
>>> quello che vuoi già esiste in Plone (3) :)
>>>
>>> Nel panello @@manage-portlets invece di aggiungere un "classic portlet"
>>> puoi sempre aggiungere un portlet basato su una Collezione (già presente nel
>>> tuo portale). Tale portlet quindi, presenterà i risultati tirati fuori dal
>>> portlet.
>>>
>>> Certo. Ma il collection portlet mi mostra il risultato della ricerca come
>> "link" al documento. Io vorrei avere dentro il portlet il documento stesso.
>>
>> Per capirci:
>> in www.isisromero.it trovi il portlet "ultimi elementi modificati"
>> (foglietto  azzurro) costruito come collection: il risultato è una serie di
>> link. Questo succede anche se l'esito della ricerca è 1 solo documento.
>>
>> Sempre nello stesso sito il portlet "il libro della settimana", invece è
>> un classic portlet la cui ricerca è affidata alla riga di codice che mi hai
>> aiutato a costruire:
>>
>> qui viene restituito direttamente il documento, non il link al documento.
>>
>> Magari, però, sono io che sottovaluto i collection portlet......
>>
>> faber
>>
>>>  Vito
>>>
>>> Il giorno 12 gennaio 2010 13.48, Fabrizio Rota <fabrizio.rota a gmail.com>ha scritto:
>>>
>>>
>>>>
>>>> Il giorno 12 gennaio 2010 11.37, Vito Falco <vitofalco a gmail.com> ha
>>>> scritto:
>>>>
>>>> Ciao,
>>>>> puoi spiegare meglio il tuo obiettivo? Non riesco a fornirti una
>>>>> risposta se non capisco la domanda :)
>>>>>
>>>> Certamente.
>>>> La riga
>>>> presults python:context.portal_catalog(portal_type='News Item',
>>>>                          path='/romero/avvisi/libri',
>>>> sort_on='effective', sort_order='reverse')
>>>> fa una ricerca sul catalog cercando le news che stanno in una certa
>>>> cartella.
>>>>
>>>> Scrivere questa riga non è magari difficile (per me un po' lo è......)
>>>> ma certamente le ricerche si possono "costruire" in modo "comodo" con le
>>>> collezioni, solo che poi il portlet "collezioni" invece che "stampare" il
>>>> documento che soddisfa la ricerca si limita ad elencarlo come link.
>>>>
>>>> Sarebbe bello poter costruire un portlet "classic" ove la parte che "fa
>>>> la ricerca" non sia una riga come quella sopra, ma qualcosa che fa
>>>> riferimento ad una collezione costruita a colpi di click......
>>>>
>>>> Spero sia un po' più chiaro ma, anche se non lo fosse, con le tue
>>>> indicazioni ho già risolto per cui - sempre e comunque - ti ringrazio.
>>>>
>>>> faber
>>>>
>>>>
>>>>
>>>>
>>>>> Vito
>>>>>
>>>>> Il giorno 11 gennaio 2010 18.45, Fabrizio Rota <
>>>>> fabrizio.rota a gmail.com> ha scritto:
>>>>>
>>>>> è possibile "foraggiare" la ricerca
>>>>>>
>>>>>>
>>>>>> tal:define="presults python:context.portal_catalog(portal_type='News
>>>>>> Item',
>>>>>>                          path='/romero/avvisi/libri',
>>>>>> sort_on='effective', sort_order='reverse')"
>>>>>>
>>>>>> che qui è fatta dentro una cartella con il risultato di una
>>>>>> collezione?
>>>>>> In pratica, non è che al posto di path=... si può in qualche modo
>>>>>> linkare una collezione?
>>>>>>
>>>>>> In questo modo avrei la comodità di impostare la "logica" della
>>>>>> ricerca con le collezioni e la flessibilità di "stampare" il risultato del
>>>>>> classic portlet.....
>>>>>> Sarebbe proprio bello.....
>>>>>>
>>>>>> grazie ancora
>>>>>>
>>>>>> faber
>>>>>>
>>>>>> Il giorno 11 gennaio 2010 18.31, Fabrizio Rota <
>>>>>> fabrizio.rota a gmail.com> ha scritto:
>>>>>>
>>>>>> Funziona perfettamente!
>>>>>>> G R A Z I E !!!!!!!!!
>>>>>>>
>>>>>>> faber
>>>>>>>
>>>>>>>
>>>>>>> Il giorno 11 gennaio 2010 18.28, Vito Falco <vitofalco a gmail.com> ha
>>>>>>> scritto:
>>>>>>>
>>>>>>> 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
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Fabrizio
>>>>>>>
>>>>>>> --------------------
>>>>>>> "Life is what happens to you while you're busy making other plans" -
>>>>>>> J. Lennon
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Fabrizio
>>>>>> --------------------
>>>>>> "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
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Fabrizio
>>>> --------------------
>>>> "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
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>> --
>> Fabrizio
>> --------------------
>> "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
>
> _______________________________________________
> 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
>



-- 
Fabrizio
--------------------
"Life is what happens to you while you're busy making other plans" - J.
Lennon
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20100112/8e06fa71/attachment.html>


Maggiori informazioni sulla lista Plone-IT