Comment 2 for bug 226555

Revision history for this message
Reed O'Brien (reedobrien) wrote :

given a viewlet manager:

class HeaderManager(grok.ViewletManager):
    grok.name('header')
    grok.context(site)

and a viewlet:

class HeaderViewlet(grok.Viewlet):
    grok.viewletmanager(HeaderManager)
    grok.context(site)
    grok.template('header')

The view.url method in the header ZPT:

<div id="visual-wrapper">
  <div id="site-header">
   <p class="hidden-structure">
     <a tal:attributes="href python:view.url() + u'/#content';
   accesskey string:2;
   title string:Skip to content">Skip To Content</a>
...

generates the url:

http://url/app/index/headerviewlet/#content

which doesn't exist, so giving context is required to generate a working url.

<a tal:attributes="href python:view.url(context) + u'/#content';

generates:

http://url:8080/app/#content

Which is correct.

I do not know if this is intended behavior, but per a conversation with philiKON in #grok
(http://jw.n--tree.net/irclogs/%23grok/%23grok.2008-05-04.log.html) I am filing this.