Sì, ho provato entrambi.
Mi dà noia il fatto che PFG mi genera la news con il titolo accentato e
come news Plone non mi fa una piega.
Nel template del portlet invece, si rifiuta...
Boh: per adesso correggo a mano e metto l'apostrofo al posto della
accentata (bello schifo, vero?).

PS: ho notato che Plone 4.3.1 propone la codifica HTML5 salvo poi non
passare la validazione nelle cartelle con vista folder_listing che usano
una struttura dl dt dd: non potevano lasciare xthml?


Il giorno 23 luglio 2013 09:14, Yuri <[email protected]> ha scritto:

> Il 22/07/2013 16:13, Fabrizio Rota ha scritto:
>
>  Può essere collegato?
>> https://dev.plone.org/ticket/**13631 <https://dev.plone.org/ticket/13631>
>>
>
> Non credo.
>
> hai provato a mettere decode al posto di encode in quello che avevo
> scritto sotto?
>
>
>>
>> Il giorno 22 luglio 2013 13:41, Fabrizio Rota 
>> <[email protected]<mailto:
>> fabrizio.rota@gmail.**com <[email protected]>>> ha scritto:
>>
>>
>>     Nulla, non funge lo stesso:
>>
>>     Tipo di eccezione
>>         UnicodeDecodeError
>>     Valore eccezione
>>         'ascii' codec can't decode byte 0xc3 in position 85: ordinal
>>         not in range(128)
>>
>>     La cosa assurda è che il "libro della settimana" visto come news
>>     funziona perfettamente: è mostrarlo nel portlet che dà questo
>>     problema. Boh!
>>
>>
>>     Grazie dell'attenzione!
>>
>>
>>
>>
>>     Il giorno 22 luglio 2013 08:49, Yuri <[email protected]
>>     <mailto:[email protected]>> ha scritto:
>>
>>
>>         Il 19/07/2013 14:09, Fabrizio Rota ha scritto:
>>
>>             Uso un portlet "tal" per mostrare il "libro della
>>             settimana" che gli utenti caricano compilando un form
>>             ploneformgen.
>>
>>             Il libro della settimana viene mappato verso una
>>             normalissima news.
>>
>>             Se il titolo contiene accentate, il portlet dà errore
>>             unidecoderror.
>>
>>             il codice del portlet tal è questo:
>>
>>
>>
>>             <metal:block define-macro="portlet">
>>             <div id="portlet_libri"
>>             tal:define="presults
>>             python:context.portal_catalog(**portal_type='News Item',
>>             
>> path='/www.isisromero.gov.it/**news/libri<http://www.isisromero.gov.it/news/libri>
>>             
>> <http://www.isisromero.gov.it/**news/libri<http://www.isisromero.gov.it/news/libri>
>> >
>>             
>> <http://www.isisromero.gov.it/**news/libri<http://www.isisromero.gov.it/news/libri>
>> >',
>>             sort_on='effective', sort_order='reverse')"
>>
>>             tal:condition="presults">
>>
>>
>>             <tal:block define="pobj python:presults[0].getObject()**">
>>
>>
>>             <h2> Libro della settimana</h2>
>>             <h3 tal:content=pobj/Title>IL TITOLO DEL LIBRO </h3>
>>
>>
>>         a parte il fatto che puoi evitare di fare il getObject:
>>
>>         <h3 tal:content="python:presults[**0].Title" />
>>
>>         se hai problemi per le accentate fai così:
>>
>>         tal:content="python:pobj.**Title().encode('utf-8')" (o decode,
>>         uno dei due funziona :-D)
>>
>>         Comunque è strano perché dovresti sempre ottenere la stringa
>>         giusta senza encoding, quindi probabilmente il problema sta
>>         nello script che crea l'oggetto (cioè quello che passi a
>>         setTitle, prova a fare delle prove lì con decode/encode). Puoi
>>         anche verificare come il catalogo ha indicizzato quel titolo,
>>         andando in portal_catalog.
>>
>>
>>
>>             .........
>>
>>             Il sito del portlet è www.isisromero.gov.it
>>             <http://www.isisromero.gov.it> <http://www.isisromero.gov.it>
>>
>>
>>
>>             Come posso far digerire le accenteate al portlet? Il
>>             "libro della settimana" come oggetto news viene creato
>>             regolarmente, il problema è la visualizzazione tramite
>>             portlet!
>>
>>             --             Fabrizio
>>             --------------------
>>             Non inviato da IPhone
>>
>>             "Life is what happens to you while you're busy making
>>             other plans" - J. Lennon
>>
>>             “If you think education is expensive, try ignorance” - D. Bok
>>
>>             Life is like a game of cards. The hand you are dealt is
>>             determinism; the way you play it is free will - Jawaharlal
>>             Nehru
>>
>>
>>             ______________________________**_________________
>>             Plone-IT mailing list
>>             [email protected] 
>> <mailto:[email protected].**org<[email protected]>
>> >
>>
>>             
>> https://lists.plone.org/**mailman/listinfo/plone-plone-**it<https://lists.plone.org/mailman/listinfo/plone-plone-it>
>>             http://plone-regional-forums.**221720.n2.nabble.com/Plone-**
>> Italy-f221721.html<http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html>
>>
>>
>>         ______________________________**_________________
>>         Plone-IT mailing list
>>         [email protected] 
>> <mailto:[email protected].**org<[email protected]>
>> >
>>
>>         
>> https://lists.plone.org/**mailman/listinfo/plone-plone-**it<https://lists.plone.org/mailman/listinfo/plone-plone-it>
>>         http://plone-regional-forums.**221720.n2.nabble.com/Plone-**
>> Italy-f221721.html<http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html>
>>
>>
>>
>>
>>     --     Fabrizio
>>     --------------------
>>     Non inviato da IPhone
>>
>>     "Life is what happens to you while you're busy making other plans"
>>     - J. Lennon
>>
>>     “If you think education is expensive, try ignorance” - D. Bok
>>
>>     Life is like a game of cards. The hand you are dealt is
>>     determinism; the way you play it is free will - Jawaharlal Nehru
>>
>>
>>
>>
>> --
>> Fabrizio
>> --------------------
>> Non inviato da IPhone
>>
>> "Life is what happens to you while you're busy making other plans" - J.
>> Lennon
>>
>> “If you think education is expensive, try ignorance” - D. Bok
>>
>> Life is like a game of cards. The hand you are dealt is determinism; the
>> way you play it is free will - Jawaharlal Nehru
>>
>>
>> ______________________________**_________________
>> Plone-IT mailing list
>> [email protected]
>> https://lists.plone.org/**mailman/listinfo/plone-plone-**it<https://lists.plone.org/mailman/listinfo/plone-plone-it>
>> http://plone-regional-forums.**221720.n2.nabble.com/Plone-**
>> Italy-f221721.html<http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html>
>>
>
> ______________________________**_________________
> Plone-IT mailing list
> [email protected]
> https://lists.plone.org/**mailman/listinfo/plone-plone-**it<https://lists.plone.org/mailman/listinfo/plone-plone-it>
> http://plone-regional-forums.**221720.n2.nabble.com/Plone-**
> Italy-f221721.html<http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html>
>



-- 
Fabrizio
--------------------
Non inviato da IPhone

"Life is what happens to you while you're busy making other plans" - J.
Lennon

“If you think education is expensive, try ignorance” - D. Bok

Life is like a game of cards. The hand you are dealt is determinism; the
way you play it is free will - Jawaharlal Nehru
_______________________________________________
Plone-IT mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-plone-it
http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html

Rispondere a