[Zope-CMF] Re: Using CMF metadata in ZPT pages - why are thes
e two different?
Anton Hughes
Anton.Hughes at utas.edu.au
Thu Sep 18 18:41:36 EDT 2003
grendelAI said:
> I believe your
> problem is with how you are retrieving the dataset of newsItems.
Maybe I need to be a bit clearer. The script *works* when I use it with a
batch of newsitems. It's in newsitem_view using here/Subject where its
behaviour is unexpected...
>But, based on your explanation the removal
>of the tal:condition causes the news/Subject to be executed. However, news
=
>nothing.
If I do this:
<span tal:condition="here/Subject">Print this</span>
here/Subject evaluates to nothing so 'Print this' never appears. *However*
the following
<span tal:replace="here/Subject">
results in this
('Subject1',)
which is clearly not nothing. And like I said, the tal:condition statement
works fine when the object is retrieved as part of a batch. So why is
tal:condition acting differently between the two contexts?
Anton
-----Original Message-----
From: grendelAI [mailto:grendelAI at msn.com]
Sent: Thursday, 18 September 2003 11:59 AM
To: zope-cmf at zope.org
Subject: [Zope-CMF] Re: Using CMF metadata in ZPT pages - why are these
two different?
I recently went through some very similar frustrations. If you can
display this section
possibly I can pinpoint it more. So
you are trying to retrieve the subject attribute from nothing which will
throw an error. Again I would inspect the statement retrieving the list of
news items as well as insuring
you have news items to retrieve.
Note by retrieval statement is below:
results
python:container.portal_catalog.searchResults(meta_type='News
Item',sort_on='created',sort_order='reverse',review_state='published',path='
/Plone/'+path);
I had to use the searchResults method and additionally prefix the path
statement with my site root in order for it to retrieve news items from the
folder.
Hope this helps
_______________________________________________
Zope-CMF maillist - Zope-CMF at zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf
See http://collector.zope.org/CMF for bug reports and feature requests
More information about the Zope-CMF
mailing list