On Fri, May 22, 2009 at 11:06 PM, Ferran Fontcuberta <[email protected]>wrote:

>
> Hello again, people :)
>
> I want to use web.template.render with a base=index.html but in the
> index.html i'm using a var that fills the menu.
>
> Now i'm trying to do this:
>
> index.html
>
> $def with (content)
> <ul>
> $for seccio in menu:
>        <li>$seccio</li>
>        $if len(menu[seccio]) > 2:
>                <ul>
>                $for sub in menu[seccio]:
>                        <li><a href="$menu[seccio][sub]">$sub</a></li>
>                </ul>
> </ul>
> <div>$:content</div>
>
> show.html
>
> $def with (menu, lists)
> <ul>
> $for list in lists:
>        <li>$list</li>
> </ul>
>
> index.py
>
> tpl = web.template.render('tpl/', base="index")
>
> tpl.show(menu, lists) does not work... any ideas?
>
> Thank you!
>

maybe in the index.html can't use the 'menu' vars. try to delete these:

<ul>
$for seccio in menu:
       <li>$seccio</li>
       $if len(menu[seccio]) > 2:
               <ul>
               $for sub in menu[seccio]:
                       <li><a href="$menu[seccio][sub]">$sub</a></li>
               </ul>
</ul>

-- 
百才招聘(baicai.com).产品部
Email: [email protected]
Gtalk: [email protected]
twitter.com/qichangxing

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to