[web2py] Re: how to show multiple controller's views on the same page?

2016-02-23 Thread Ron Chatterjee
response.view = 'default/show_project.html'

Works like a champ! You are the man Anthony!!! Thank you.

On Sunday, February 21, 2016 at 8:14:05 PM UTC-5, Anthony wrote:
>
> In one or both of the controllers:
>
> response.view = 'default/my_shared_view.html'
>
> Or create two separate views that contain only the following:
>
> {{include 'default/my_shared_view.html'}}
>
> Anthony
>
> On Sunday, February 21, 2016 at 5:09:33 PM UTC-5, Ron Chatterjee wrote:
>>
>> Any other way to do this without using LOAD?
>>
>> I have two controller using the same view pretty much idential html:
>>
>> def show_project():
>> projects = []
>> projects = db().select(db.Project.ALL, orderby = 
>> db.Project.created_on, limitby=(0,100))
>> return dict(projects = projects)
>>
>> def projects_by_clicks()::
>> projects = db(db.Project.Terms.contains(project_term)).select()
>> return dict(projects = projects)
>>
>> How to use the same view for multiple controller?
>>
>> On Wednesday, January 12, 2011 at 8:23:10 AM UTC-5, Mirek Zvolský wrote:
>>>
>>> > I am wondering whether it is possible to show multiple controller's 
>>> views... 
>>>
>>> Inside the controller code you can change to other view: 
>>> if something: 
>>> response.view='xxx.html' 
>>>
>>> In the view itself you can have more named parts. 
>>> In such case the extended layout has not only one {{include}} command, 
>>> but more {{include xxx}} commands /I don't remember the syntax 
>>> exactly/. 
>>> Inside such partial views you can control use of that html part by 
>>> {{if something:}} Output html here {{pass}} 
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to show multiple controller's views on the same page?

2016-02-21 Thread Anthony
In one or both of the controllers:

response.view = 'default/my_shared_view.html'

Or create two separate views that contain only the following:

{{include 'default/my_shared_view.html'}}

Anthony

On Sunday, February 21, 2016 at 5:09:33 PM UTC-5, Ron Chatterjee wrote:
>
> Any other way to do this without using LOAD?
>
> I have two controller using the same view pretty much idential html:
>
> def show_project():
> projects = []
> projects = db().select(db.Project.ALL, orderby = 
> db.Project.created_on, limitby=(0,100))
> return dict(projects = projects)
>
> def projects_by_clicks()::
> projects = db(db.Project.Terms.contains(project_term)).select()
> return dict(projects = projects)
>
> How to use the same view for multiple controller?
>
> On Wednesday, January 12, 2011 at 8:23:10 AM UTC-5, Mirek Zvolský wrote:
>>
>> > I am wondering whether it is possible to show multiple controller's 
>> views... 
>>
>> Inside the controller code you can change to other view: 
>> if something: 
>> response.view='xxx.html' 
>>
>> In the view itself you can have more named parts. 
>> In such case the extended layout has not only one {{include}} command, 
>> but more {{include xxx}} commands /I don't remember the syntax 
>> exactly/. 
>> Inside such partial views you can control use of that html part by 
>> {{if something:}} Output html here {{pass}} 
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: how to show multiple controller's views on the same page?

2016-02-21 Thread Roberto Perdomo
Why not return two vars in one controller?

Instead of two controllers with one return, you can return two vars in
one controller:

return (project1 = project1, project2 = project2)

2016-02-21 17:39 GMT-04:30 Ron Chatterjee :
> Any other way to do this without using LOAD?
>
> I have two controller using the same view pretty much idential html:
>
> def show_project():
> projects = []
> projects = db().select(db.Project.ALL, orderby = db.Project.created_on,
> limitby=(0,100))
> return dict(projects = projects)
>
> def projects_by_clicks()::
> projects = db(db.Project.Terms.contains(project_term)).select()
> return dict(projects = projects)
>
> How to use the same view for multiple controller?
>
> On Wednesday, January 12, 2011 at 8:23:10 AM UTC-5, Mirek Zvolský wrote:
>>
>> > I am wondering whether it is possible to show multiple controller's
>> > views...
>>
>> Inside the controller code you can change to other view:
>> if something:
>> response.view='xxx.html'
>>
>> In the view itself you can have more named parts.
>> In such case the extended layout has not only one {{include}} command,
>> but more {{include xxx}} commands /I don't remember the syntax
>> exactly/.
>> Inside such partial views you can control use of that html part by
>> {{if something:}} Output html here {{pass}}
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to show multiple controller's views on the same page?

2016-02-21 Thread Ron Chatterjee
Any other way to do this without using LOAD?

I have two controller using the same view pretty much idential html:

def show_project():
projects = []
projects = db().select(db.Project.ALL, orderby = db.Project.created_on, 
limitby=(0,100))
return dict(projects = projects)

def projects_by_clicks()::
projects = db(db.Project.Terms.contains(project_term)).select()
return dict(projects = projects)

How to use the same view for multiple controller?

On Wednesday, January 12, 2011 at 8:23:10 AM UTC-5, Mirek Zvolský wrote:
>
> > I am wondering whether it is possible to show multiple controller's 
> views... 
>
> Inside the controller code you can change to other view: 
> if something: 
> response.view='xxx.html' 
>
> In the view itself you can have more named parts. 
> In such case the extended layout has not only one {{include}} command, 
> but more {{include xxx}} commands /I don't remember the syntax 
> exactly/. 
> Inside such partial views you can control use of that html part by 
> {{if something:}} Output html here {{pass}} 
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to show multiple controller's views on the same page?

2011-01-12 Thread Mirek Zvolský
 I am wondering whether it is possible to show multiple controller's views...

Inside the controller code you can change to other view:
if something:
response.view='xxx.html'

In the view itself you can have more named parts.
In such case the extended layout has not only one {{include}} command,
but more {{include xxx}} commands /I don't remember the syntax
exactly/.
Inside such partial views you can control use of that html part by
{{if something:}} Output html here {{pass}}


[web2py] Re: how to show multiple controller's views on the same page?

2011-01-11 Thread Massimo Di Pierro
I think you want the LOAD helper.

On Jan 11, 3:42 pm, ivytony ivyt...@gmail.com wrote:
 I'm a newb to web2py and have been reading the Web2py book freely
 online. I am wondering whether it is possible to show multiple
 controller's views on the same page (say index page), the reason I'm
 asking this is I can only have one view for each controller 
 (e.g.http://localhost/web2py/app/controller1/view1.html), but what if I
 want to show different controllers' output on the index page? can I do
 this by including their views in the index view page?


[web2py] Re: how to show multiple controller's views on the same page?

2011-01-11 Thread Luther Goh Lu Feng
You will want to look at components in Chapter 13

On Jan 12, 5:44 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I think you want the LOAD helper.

 On Jan 11, 3:42 pm, ivytony ivyt...@gmail.com wrote:







  I'm a newb to web2py and have been reading the Web2py book freely
  online. I am wondering whether it is possible to show multiple
  controller's views on the same page (say index page), the reason I'm
  asking this is I can only have one view for each controller 
  (e.g.http://localhost/web2py/app/controller1/view1.html), but what if I
  want to show different controllers' output on the index page? can I do
  this by including their views in the index view page?