this is my controller

from gluon.tools import Crud
crud = Crud(db)

def index():
    form=SQLFORM(db.poruke,fields=['poruka','post_author'])
    if form.accepts(request.vars,session):
        session.flash="new post accepted!"
        redirect(URL(r=request))
    poruke=db().select(db.poruke.ALL)
    return dict(form=form,poruke=poruke)

def people():
    crud.settings.formstyle = ('divs')
    form = crud.create(db.person,next=URL('people'),message=T("record
created"))
    persons = crud.select(db.person,fields=['name'],headers={'name':
'Name'})
    return dict(form = form,persons=persons)

def user():
    auth.settings.formstyle = ('divs')
    return dict(form=auth())

this is my layout

<!DOCTYPE html>
<html>
    <head>
        <title>Web2Py</title>
    </head>
    <body>
    {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}<br
/>
        {{include}}

         <div class="sidebar">
         {{block mysidebar}}
            default sidebar
         {{end}}
         </div>

         <div class="ez-box" id="footer">
          {{=T('Copyright')}} © 2010 -
          {{=T('Powered by')}} <a href="http://www.web2py.com";>web2py</a>
    </div>
    </body>
</html>

this is my view

{{extend 'layout.html'}}

{{for poruke in poruke:}}
{{if poruke.post_author:}}
{{=poruke.post_author}} says {{=poruke.poruka}} <br />
{{else:}}
Anonymous says {{=poruke.poruka}}<br />
{{pass}}
{{pass}}

{{=form}}

{{include 'test.html'}}

{{block mysidebar}}
my block
{{end}}

How t make implementation of

response <http://web2py.com/book/default/docstring/response>.menu =
[('Google', False, 'http://www.google.com',[]),

                 ('Index',  True,  URL
<http://web2py.com/book/default/docstring/URL>('index'), [])]

*
*



- - Miroslav Gojic - -



On Fri, Oct 7, 2011 at 18:58, Anthony <abasta...@gmail.com> wrote:

> On Friday, October 7, 2011 1:31:08 AM UTC-4, miroslavgojic wrote:
>>
>> Thanks for blocks - that work, this is similar to modules in joomla, I can
>> write small block and get content on specific place at layout.
>>
>> I tray to use next code:
>> response <http://web2py.com/book/default/docstring/response>.menu = 
>> [('Google', False, 'http://www.google.com',[]),
>>
>>                  ('Index',  True,  URL 
>> <http://web2py.com/book/default/docstring/URL>('index'), [])]
>>
>> but without any success.
>> I reed in book that mentioned code I must put in controller but how to get
>> same than in layout and does in controller I must use definition or haw.
>>
>
> Can you show the relevant controller and view code related to the menu?
> What do you expect to see, and what do you actually see? Note, typically you
> would pass response.menu to the MENU() helper, which will turn it into a
> nested unordered list, which can then be styled/displayed as a menu via CSS
> and/or Javascript (e.g., the 'welcome' app uses the Superfish Javascript
> menu).
>
> Anthony
>
>

Reply via email to