[BlueBream] get site / portal root

Adam GROSZER agroszer at gmail.com
Tue Aug 3 07:27:36 EDT 2010


Hello Justin,

Or, you could do:

class SiteTitle(BrowserPage):
    def __call__(self):
        site = hooks.getSite()
        return site.title


  <page
      name="siteTitle"
      for="*"
      class=".SiteTitle"
      permission="zope.Public"
      />

<head>
<title tal:content="context/@@siteTitle">sitetitle</title>
</head>
      
Tuesday, August 3, 2010, 7:11:48 AM, you wrote:

JR> On Mon, Aug 2, 2010 at 12:32 AM, Adam GROSZER <agroszer at gmail.com> wrote:
>> Hello Justin,
>>
>> from zope.component import hooks
>> site = hooks.getSite()
>>

JR> Sweet!  Thanks Adam..

>> Beware, this will get set during traversal and is a thread_local.
>>

JR> Good to know.  I just basically want to grab the site's name / title
JR> and use it in some places of the ui. :)

JR> Thanks, again!
JR> _______________________________________________
JR> bluebream mailing list
JR> bluebream at zope.org
JR> https://mail.zope.org/mailman/listinfo/bluebream


-- 
Best regards,
 Adam GROSZER                            mailto:agroszer at gmail.com
--
Quote of the day:
If Microsoft built cars... you'd have to push the "Start" button to shut off the engine.



More information about the bluebream mailing list