[Setup] News Item properties

mtzolo at gmail.com mtzolo at gmail.com
Tue Feb 28 09:01:48 UTC 2006


I'm trying to render the last new inserted via plone on a zope page template
(that is the site main page, index_html ).
I went on
/ plone_portlets<http://adelchi.org:9673/Engim0.2/portal_skins/plone_portlets/manage_workspace>
/ portlet_news<http://adelchi.org:9673/Engim0.2/portal_skins/plone_portlets/portlet_news/manage_workspace>

and I toke the piece I need:

<div metal:define-macro="portlet"
     tal:define="results python:request.get('news',
here.portal_catalog.searchResults( portal_type='News Item'
              , sort_on='Date'

              , sort_order='reverse'
              , review_state='published')[:5]);


     tal:condition="python:test(template.getId()!='news' and results, 1, 0)">

    <div class="portlet" id="portlet-news">

        <h5 i18n:translate="box_news">News</h5>

        <div class="portletBody">

            <tal:block tal:repeat="obj results">

                <div tal:define="oddrow repeat/obj/odd"
                     tal:attributes="class python:test(oddrow,
'portletContent even', 'portletContent odd')">

                    <a href=""
                       tal:attributes="href obj/getURL;
                                       title obj/Description">
                        <tal:block replace="structure here/newsitem_icon.gif"/>

                        <span tal:replace="python:test(obj.Title,
obj.Title, obj.getId)"> Extended Calendar Product </span>

etc etc etc

the fact is that I should have also the first 500 characters of the news (an
abstract to put in the home page with a link of the entirely news)
I tryed with:

                        <span tal:replace="python:test(obj.Dcoument,
obj.Dcoument, obj.getId)"> Extended Calendar Product </span>
                        <span tal:replace="python:test(
obj.Text, obj.Text, obj.getId)"> Extended Calendar Product </span>
                        <span tal:replace="python:test(obj.Content,
obj.Content, obj.getId)"> Extended Calendar Product </span>

                        <span tal:replace="python:test(obj.Body,
obj.Body, obj.getId)"> Extended Calendar Product </span>

but I cannot show out the content... I have looked on references, on google
and on zope 'doc' tab but nothing at all...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-setup/attachments/20060228/c2d23e83/attachment-0002.html>

More information about the Setup mailing list