Ciao,
perchè usi il SearchableText?

Io, ad occhio, avrei fatto un <div tal:replace="structure pobj/getText">This
element is a comment.</div>
oppure
<div tal:replace="structure pobj/Text">This element is a comment.</div>

Vito

Il giorno 24 dicembre 2009 09.26, Fabrizio Rota <fabrizio.r...@gmail.com> ha
scritto:

> Sto modificando questo codice di weblion
> https://weblion.psu.edu/trac/weblion/wiki/RandomImagePortlet (usato per
> mostrare in un portlet una immagina casuale) in modo che mostri il contenuto
> di una news casuale.
>
>
> <div metal:define-macro="portlet">
>      <div  id="portlet_randomphoto"
>              tal:define="presults 
> python:context.portal_catalog(portal_type='Image',
>                          path='/yaks/images-randomize')"
>              tal:condition="presults">
>              <div>
>
>                <span tal:define="pobj 
> python:random.choice(presults).getObject()">
>                      <img tal:replace="structure pobj/image" />
>                      <span tal:content="string:${pobj/Description}">[displays 
> description of image]</span>
>                </span>
>           </div>
>      </div>
> </div>
>
>
>
> Sto provando con questo codice
>
> <div metal:define-macro="portlet">
>      <div  id="portlet_randomphoto"
>              tal:define="presults
> python:context.portal_catalog(portal_type='News Item',
>                          path='/test/news')"
>              tal:condition="presults">
>              <div>
>
>                <span tal:define="pobj
> python:random.choice(presults).getObject()">
>
>                      <span
> tal:content="string:${pobj/Description}">[displays description of
> image]</span>
>                    <div tal:replace="structure pobj/SearchableText">This
> element is a comment.</div>
>                </span>
>           </div>
>      </div>
> </div>
>
> Ma non riesco ad estrarre il testo della news in modo decente.
> Con SearchableText, infatti,  il testo viene fuori come non formattato e si
> prende pure la descrizione della immagine a commento della news.
> Forse che il testo della news non viene estratto con getObject()?
> C'è qualche altro modo di ottenerlo?
>
> a presto
>
> faber
>
> --------------------
> "Life is what happens to you while you're busy making other plans" - J.
> Lennon
>
> _______________________________________________
> Plone-IT mailing list
> Plone-IT@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@lists.plone.org
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

Rispondere a