Thanks that was helpful and got me further but I need a bit more help.
I want to have a menu item that shows the current total value of a
> calculation,
> as well as a sparkline chart showing the values of a time series.
>
> I read the twitter bootstrap docs to find out what I think I need is a
> "navigation list" that contains hrefs to functions, like variables.
> I want these to show up visually as information on the nav bar.
>
> From the web2py-users, it seems that the menu tuple can be modified, the
> first and third elements of the tuple can be nested helper lists and the
> boolean in the middle can be used to turn on/off menu items, or just left
> alone.
>
> The appadmin menu appears to contain both icons and variables (still
> running) so I am looking at that, too. As well the welcome app has nested
> lists in the menu.py.
>
> but I need to see more examples of nested helpers. In meantime more
> experimenting.
> Here is something closer to what I need using your suggestion of putting
> test1 into myresult,
> which only works if I put it in the model file above the menu.
> It's not styled yet, but it has values appearing in the menu.
>
> <please see attached jpg>
>
> Can you please help me figure out how to put the variable in the menu when
> it's coming from a controller function instead like test1? That is where
> most of my functions are.
>
> models/menusample.py contains
> def test1():
> a = 20
> b = 30
> myval = a+b
> return myval
>
> myresult = test1()
>
>
> response.menu = [
> (CAT(T('Power Production'),BR(),B(myresult),B('W'),BR(),A('Today''s
> Peak',_href=URL('default','index')), myresult, 'W'), False,[]), #nearly
> (CAT(T('Daily
> Production'),BR(),B(URL=('default','test2')),B('W'),BR(),'Today''s Peak',
> myresult, 'W'), False,[]), #get no value from test2, how to get value?
> (T('Item 2'), False, URL('default','index'), [])
> ]
>
>
> controllers/defaults.py contains function test2,
>
> def test2():
> a = 26
> b = 32
> myval = a+b
> #return dict(myval=myval) #use whichever return will work in menu
> return myval
>
>
--
---
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/groups/opt_out.
<<attachment: menu.jpg>>

