[Plone-IT] News in homepage

Zardetto Carlo carlo a artmediastudio.com
Gio 22 Set 2011 14:13:24 UTC


Inserendo
<div tal:content="structure news/getObject/getText"> </div>

il plone va in crash


Site Error

An error was encountered while publishing this resource.

TraversalError

(>, 'getText') (Also, the following error occurred while attempting to 
render the standard error message, please see the event log for full 
details: (<bound method mybrains.getObject of 
<Products.ZCatalog.Catalog.mybrains object at 0xfe42e14>>, 
'getText'))Traceback (innermost last): Module ZPublisher.Publish, line 202, 
in publish_module_standard Module ZPublisher.Publish, line 150, in publish 
Module plone.app.linkintegrity.monkey, line 21, in 
zpublisher_exception_hook_wrapper Module Zope2.App.startup, line 221, in 
zpublisher_exception_hook Module ZPublisher.Publish, line 119, in publish 
Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 
42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ 
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module 
Products.CMFCore.FSPageTemplate, line 216, in _exec Module 
Products.CMFCore.FSPageTemplate, line 155, in pt_render Module 
Products.PageTemplates.PageTemplate, line 89, in pt_render Module 
zope.pagetemplate.pagetemplate, line 117, in pt_render Module 
zope.tal.talinterpreter, line 271, in __call__ Module 
zope.tal.talinterpreter, line 346, in interpret Module 
zope.tal.talinterpreter, line 891, in do_useMacro Module 
zope.tal.talinterpreter, line 346, in interpret Module 
zope.tal.talinterpreter, line 536, in do_optTag_tal Module 
zope.tal.talinterpreter, line 521, in do_optTag Module 
zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, 
line 346, in interpret Module zope.tal.talinterpreter, line 957, in 
do_defineSlot Module zope.tal.talinterpreter, line 346, in interpret Module 
zope.tal.talinterpreter, line 536, in do_optTag_tal Module 
zope.tal.talinterpreter, line 521, in do_optTag Module 
zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, 
line 346, in interpret Module zope.tal.talinterpreter, line 861, in 
do_defineMacro Module zope.tal.talinterpreter, line 346, in interpret Module 
zope.tal.talinterpreter, line 824, in do_loop_tal Module 
zope.tal.talinterpreter, line 346, in interpret Module 
zope.tal.talinterpreter, line 745, in do_insertStructure_tal Module 
Products.PageTemplates.Expressions, line 221, in evaluateStructure Module 
zope.tales.tales, line 696, in evaluate - URL: main_template - Line 160, 
Column 0 - Expression: - Names: {'container': , 'context': , 'default': , 
'here': , 'loop': {u'news': }, 'nothing': None, 'options': {'args': ()}, 
'repeat': , 'request': , 'root': , 'template': , 'traverse_subpath': [], 
'user': } Module zope.tales.expressions, line 217, in __call__ Module 
Products.PageTemplates.Expressions, line 153, in _eval Module 
zope.tales.expressions, line 124, in _eval Module 
Products.PageTemplates.Expressions, line 83, in boboAwareZopeTraverse Module 
zope.traversing.adapters, line 164, in traversePathElement - 
__traceback_info__: (>, 'getText') Module zope.traversing.adapters, line 52, 
in traverse - __traceback_info__: (>, 'getText', []) TraversalError: (see 
above)



-----Messaggio originale----- 
From: Simone Orsi
Sent: Thursday, September 22, 2011 3:28 PM
To: La lista degli italiani appassionati di Plone.
Subject: Re: [Plone-IT] News in homepage

Ciao,

On 09/22/2011 10:09 AM, Zardetto Carlo wrote:
>      <div tal:define="presults
> python:context.portal_catalog(portal_type='News Item',
> path='/plone/news', sort_on='effective', sort_order='desc', limit=4,
> Subject='evidenza')">
>                    <div class="novita" tal:repeat="news python:
> presults[:3]">
>                    <h1 tal:content="news/Title" />
>                   <div tal:content="news/Description"><span
> tal:content="news/Description" />
>                   </div>
> <div tal:content="structure news/getText">
>                   </div>
>
>                   </div>
>                   </div>


stai ciclando direttamente su risultati della ricerca del catalog, che
non sono gli oggetti veri e propri ma "brains". Da questi puoi accedere
solo i valori indicizzati e "getText" non  uno di quelli.

nel tuo caso dovresti fare "news/getObject/getText".

HTH
_______________________________________________
Plone-IT mailing list
Plone-IT a lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-plone-it
http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html 



Maggiori informazioni sulla lista Plone-IT