Oh boy that was straightforward (when you know the answer) :o) Thanks
a lot !

Now another equally simple question (I read the turbogears book but
I am still a rookie ...)

I want to pass parameters to this template so that I can reference
them
in my included template.

Something like

mytabber=Tabber(template="ncc.templates.import", server="localhost")

so that I can reference the variable server as ${server} in the
imported template ...

Thanks again

Patrick


On Aug 25, 11:40 am, shadowfox <[EMAIL PROTECTED]> wrote:
> Patrick,
>
> This is how you do it.
> 1. Create a new template (whatevertab.kid) in the templates directory
> 2. Put whatever you want inside the tabs in there (this is the stuff
> you want to move from the controller)
> 3. Inside the controller:
>
> whatever_tab =
> Tabber(template="yourprojectname.templates.whatevertab")
>
> Done!
>
> Cheers,
> Will
>
> On Aug 23, 2:58 pm, Pezzi <[EMAIL PROTECTED]> wrote:
>
> > All,
>
> > I am just learning TurboGears (but love it already !) and I am not
> > sure how to approach this. I have searched far and wide without
> > success ...
>
> > I want to build a web app with 4 main tabs. The contents from each tab
> > should come from a kid template.
>
> > The code I have right now looks like this and works ...
>
> > controllers.py:
>
> > ...
> > class TabberDesc(CoreWD):
> >     name = "Tabber"
> >     for_widget = Tabber()
> >     template = """
> >         <div class="tabber">
> >         BlaBla
> >             <div class="tabbertab tabbertabdefault"><h2>Connection</
> > h2>Page 1</div>
> >             <div class="tabbertab"><h2>Tables</h2>Page 2</div>
> >             <div class="tabbertab"><h2>Load Data</h2>Page 3</div>
> >             <div class="tabbertab"><h2>Thesaurus</h2>Page 4</div>
> >         </div>"""
> > ...
> >         mytabber = TabberDesc()
> >         return dict(...., tabber=mytabber)
>
> > Now if I want more content in each tab I have to put in in the class
> > in controllers.py. All attempts at including content from a template
> > in this code e.g. using <?python include = kid.load_template('ncc\\\
> > \templates\\\\import.kid') ?> failed with various strange errors.
>
> > So what's a good method to use tabs and keep the controller free of
> > HTML ?
>
> > Thanks all
>
> > Patrick


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