If you put the following line in a view:
{{extend 'layout.html' if not request.ajax else None}}
that view will not compile if you elect to compile the application
(compiling is an option in the admin app). Compiling an app is optional,
but it does speed up execution. So, the above method will work, but that
view will not compile, so you won't benefit from the execution speed-up in
that case.
Anthony
On Saturday, September 14, 2013 6:25:12 PM UTC-4, Avi A wrote:
>
> Second option works, but what do you mean by "that particular view will
> not be compileable"?
>
> On Saturday, September 14, 2013 11:58:33 PM UTC+3, Avi A wrote:
>>
>>
>> Hi,
>> This is my link on the index page:
>> {{extend 'layout.html'}}
>> <div id="ajax_target">
>> .........
>> <a href="#" onclick="ajax('{{=URL('default', 'categories', args=(
>> category.id))}}', ['ajax_content'],
>> 'ajax_target')">{{=category.f_category_name}}</a>
>> ..........
>> </div>
>>
>> where ajax_content is a div I want to display from the categories page,
>> on the index page.
>> Categories page:
>> {{extend 'layout.html'}}
>> <div id="ajax_content">
>> ......
>> </div>
>>
>> It works as expected, except that it brings the whole categories page
>> (including the header and footer ), which is not expected.
>> what should I do?
>> 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].
For more options, visit https://groups.google.com/groups/opt_out.