Maximum recursion depth using context in template
Carsten Agger <carstena-Lshci/D1eht/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.user |
|---|---|
| Organization | Magenta ApS, http://www.magenta.dk |
| Message-ID | <[email protected]> |
I'm having a kind of weird problem with a viewlet template.
We're inserting a list of custom links, specified by the customer, in
the header - like an extra menu.
I want to configure this by having a folder containing only links in the
site root, i.e. accessible at "context/links".
This exists and is iterable:
>>> app.site.links
<ATFolder at /site/links>
>>> for l in app.site.links:
... print l
...
nyheder
partnerskaber
I then insert code for generating it along with our customized search
box viewlet:
<ul id="extralinks"
tal:repeat="link root/site/links">
<li class="plain" >
<a href="..." class="" title="">
<span tal:content="structure link/title"></span>
</a>
</li>
</ul>
This, however, apparently gives an infinite recursion:
RuntimeError('maximum recursion depth exceeded',) (Also, the following
error occurred while attempting to render the standard error message,
please see the event log for full details: maximum recursion depth
exceeded)
However, if I try to access specific members of existing links, it
actually "works".
Thus, having these lines in the template:
<!-- Extra links -->
<ul id="extralinks"
tal:repeat="link root/site/links/nyheder/title">
<li class="plain" >
<a href="/site/news" class="" title="">
<span tal:content="structure link"></span>
</a>
</li>
</ul>
will iterate through the title of the link "Nyheder", yielding the link
texts 'N', 'y', 'h', 'e', 'd', 'e', 'r'.
What am I doing wrong here? I find the failure to iterate through the
links while succeeding in accessing the title rather confusing.
Thanks in advance for any response!
Below, the last lines of the stack trace from the log.
Best regards
Carsten
File "/home/dbc/buildout-cache/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/home/dbc/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Products/PageTemplates/Expressions.py", line 218, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/home/dbc/buildout-cache/eggs/zope.tales-3.5.2-py2.7.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/dbc/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Products/PageTemplates/Expressions.py", line 383, in __call__
v = evaluate(var)
File "/home/dbc/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Products/PageTemplates/Expressions.py", line 225, in evaluateText
text = self.evaluate(expr)
File "/home/dbc/buildout-cache/eggs/zope.tales-3.5.2-py2.7.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/home/dbc/buildout-cache/eggs/zope.tales-3.5.2-py2.7.egg/zope/tales/expressions.py", line 217, in __call__
return self._eval(econtext)
File "/home/dbc/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Products/PageTemplates/Expressions.py", line 147, in _eval
ob = self._subexprs[-1](econtext)
File "/home/dbc/buildout-cache/eggs/zope.tales-3.5.2-py2.7.egg/zope/tales/expressions.py", line 124, in _eval
ob = self._traverser(ob, element, econtext)
File "/home/dbc/buildout-cache/eggs/Zope2-2.13.19-py2.7.egg/Products/PageTemplates/Expressions.py", line 97, in trustedBoboAwareZopeTraverse
request=request)
File "/home/dbc/buildout-cache/eggs/zope.traversing-3.13.2-py2.7.egg/zope/traversing/adapters.py", line 131, in traversePathElement
traversable = ITraversable(obj, None)
File "/home/dbc/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/hooks.py", line 104, in adapter_hook
return siteinfo.adapter_hook(interface, object, name, default)
RuntimeError: maximum recursion depth exceeded
--
Carsten Agger
Magenta ApS
Incuba, Åbogade 15
DK-8200 Aarhus N
Tlf +45 3336 9699
Dir +45 5060 1476
Mob +45 2086 5010
http://www.magenta.dk
[email protected]
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users