Cant believe reading the book I skipped this part. I was around that area. 
Thanks! now it makes sense.




On Thursday, May 15, 2014 1:49:44 PM UTC-7, yamandu wrote:
>
> It is because you are using it the wrong way.
>
> MENU helper itself generates the html marckup, ul, li, a, etc
>
> Give a look at the documentation here 
> http://web2py.com/books/default/chapter/29/05/the-views?search=menu#MENU
>
> Look that MENU has some optional arguments to setup the classes to custom 
> ones:
>
> The MENU helper takes the following optional arguments:
>
>    - _class: defaults to "web2py-menu web2py-menu-vertical" and sets the 
>    class of the outer UL elements. 
>    - ul_class: defaults to "web2py-menu-vertical" and sets the class of 
>    the inner UL elements. 
>    - li_class: defaults to "web2py-menu-expand" and sets the class of the 
>    inner LI elements. 
>    - li_first: allows to add a class to the first list element. 
>    - li_last: allows to add a class to the last list element. 
>
>
> But it always generate the same kind of structure:
>
> >>> print MENU([['One', False, 'link1', [['Two', False, 'link2']]]])
> <ul class="web2py-menu web2py-menu-vertical">
>   <li class="web2py-menu-expand">
>      <a href="link1">One</a>
>      <ul class="web2py-menu-vertical">
>         <li><a href="link2">Two</a></li>
>      </ul>
>   </li>
> </ul>
>
> I you really need a different one, you should write it your own.
>
> If your menus don't change do it hardcoded.
>
>
>
> 2014-05-15 15:58 GMT-03:00 Dave S <[email protected] <javascript:>>:
>
>>
>>
>> On Thursday, May 15, 2014 10:21:48 AM UTC-7, greenpoise wrote:
>>>
>>> Yes font-awesome is what I am trying to use. Both attempts, yours and 
>>> yamandu prompt me the same error
>>>
>>> (name, active, link) = item[:3]
>>> ValueError: need more than 2 values to unpack
>>>
>>>
>>
>> Is there a line number associated with that error message?  Is "item" 
>> something in your code, or is it part of the helper?  Evidently it's being 
>> created with only 2 values, instead of the 3 needed.  I'm tempted to say 
>> that "active" should be a boolean, but that's just a guess.
>>
>> /dps
>>
>>
>>  
>>
>>> On Wednesday, May 14, 2014 8:36:48 PM UTC-7, Joe Barnhart wrote:
>>>>
>>>> I see you're using font-awesome.  You need to add "fa" as well as the 
>>>> icon name you want "fa-home".  I also recommend you use the URL helper if 
>>>> you ever want the url re-writing features of web2py.  My recommendation is:
>>>>
>>>> A(I(_class="fa fa-home"),SPAN("Home",_class="menu-item-parent"),_href=
>>>> URL('index'))
>>>>
>>>> Please notice the underscore in the "class" and "href" entries.  That 
>>>> is how web2py knows you want those to wind up on the final HTML version of 
>>>> the element and keeps the names from colliding with Python identifiers 
>>>> (like "class").
>>>>
>>>>
>>>> On Wednesday, May 14, 2014 2:59:03 PM UTC-7, greenpoise wrote:
>>>>>
>>>>> I need help with this helper!
>>>>>
>>>>> I have this
>>>>>
>>>>> <a href="index.html" title="Home"><i class="fa-home"></i> <span class=
>>>>> "menu-item-parent">Home</span></a>
>>>>>
>>>>>
>>>>> and I made this:
>>>>>
>>>>> [A(I(SPAN(_class=('menu-item-parent','Home')), _class='fa-home',_title
>>>>> ='Home',), False, None, []),]
>>>>>
>>>>>
>>>>>
>>>>> I am missing the URL('home") cant get it to work. Where should I put 
>>>>> it?
>>>>>
>>>>>
>>>>> thanks
>>>>>
>>>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Att.
>
> Carlos J. Costa
> Cientista da Computação
> Esp. Gestão em Telecom
>
> EL MELECH NEEMAN!
> אָמֵן
>
> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to