Re: Maximum recursion depth using context in template

espen <[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
25. mars 2015 kl. 18:41 skrev Carsten Agger-2 [via Plone] <ml-node+s293351n7573465h68-PKuAHvtXa09l57MIdRCFDg@public.gmane.org>:

> 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> 

what does
<span tal:content=‘link/title’ />

return ?

(or if that does not work
<span tal:define=‘lenketittel link/title’ tal:content=‘lenketittel’ />

 
> 
>      </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
> [hidden email] 
> 
> 
> ------------------------------------------------------------------------------ 
> 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 
> [hidden email] 
> https://lists.sourceforge.net/lists/listinfo/plone-users
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://plone.293351.n2.nabble.com/Maximum-recursion-depth-using-context-in-template-tp7573465.html
> To start a new topic under General Questions, email ml-node+s293351n293352h65-PKuAHvtXa09l57MIdRCFDg@public.gmane.org 
> To unsubscribe from Plone, click here.
> NAML





--
View this message in context: http://plone.293351.n2.nabble.com/Maximum-recursion-depth-using-context-in-template-tp7573465p7573466.html
Sent from the General Questions mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.