Richard Harding wrote:
> iain duncan wrote:
>> I agree that you shouldn't need it for production sites, but it's really
>> convenient for prototyping amongst multiple coders. You can make a nice
>> python stub that pretends to be your gears site while you are breaking
>> the gears site. ;)
>>
>> Iain
> 
> I don't know. It works out nice. I've setup a test site with the beta 
> genshi code for .4 and I use a python block to check the current url vs. 
> nav menu to highlight the current page you're on from the nav menu. It's 
> display logic and makes sense to me to belong in the template vs. 
> forcing me to manually enter a "current_page" I have to pass in every 
> dict. from the controller.

Possibly. I'm basically doing that for a site I'm developing at the
moment (see thread "Extending turbogears.expose in controllers").
Previously I did do things like

<head>
...
<?python area='main' ?>
</head>

in each template and

<body>
    ...
    <span py:for="a in ('main', 'section2', 'section3')">
        <a py:strip="a == area" py:content="a" />
    </span>
    ...
</body>

in master.kid. Possibly there's a more elegant way than using <?python
?> blocks though. I suspect I could set a fake element up to be read by
master.kid, but setting the area in the controller seems to make more
semantic sense to me. Again, what'd be really nice would be to do

@expose(template='...', area='main')
def controller(self, ...):
    ...

by redefining turbogears.expose, which I've been trying to figure out
how to do. In the meantime, I'm just using an extra decorator, like so:

@expose(...)
@extra_params(area='main')
def controller(...): ...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to