did you look at your controller/menu.py file?

You should be able to see how to generate this dynamically;


On Apr 26, 12:31 pm, Julius Minka <j...@minka.sk> wrote:
> I have to implement following 4-level menu in my view:
>
> <ul class="menu1">
> <li><a href="#">Level1a</a></li>
> <li><a href="#">Level1b</a></li>
> <li><a href="#">Level1c*</a>
>   <ul class="menu1">
>   <li><a href="#">Level2a*</a>
>         <ul class="menu1">
>           <li><a href="#">Level3a*</a>
>                 <ul>                                      
>                   <li><a href="#">Level4a</a></li>
>                   <li><a href="#">Level4b</a></li>
>                   <li><a href="#">Level4c</a></li>
>                 </ul>
>           </li>
>           <li><a href="#">Level3b</a></li>
>           <li><a href="#">Level3c</a></li>
>           <li><a href="#">Level3d</a></li>
>         </ul>
>    </li>
>    <li><a href="#">Level2b</a></li>
>    <li><a href="#">Level2c</a></li>
>    <li><a href="#">Level2d</a></li>
> </ul>
> </li>
> </ul>
>
> This menu should be dynamically generated from DB
> Respective table looks as follows:
>
> db.define_table('category',
>   Field('name', 'string', length=40, required=True, notnull=False,
> unique=True),
>   Field('parent_id', 'reference category', length=5, required=False,
> notnull=False))
> db.category.parent_id.requires=IS_NULL_OR(IS_IN_DB(db,'category.id','
> %(name)s'))
>
> Menu items on the first level have no parents, all items on next levels
> define one. I can change the table if required.
>
> Can somebody suggest a good approach for doing this?
>
> Thanks,
> Julius
>
> --
> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en

Reply via email to