I was thinking about this recently. A mezzanine site that is about to
launch came to me with the front-end pre-built to use ajax for the
entire UX, which gave the project what I considered a very bad "smell"
of premature optimization. Now that the architecture and UX is built
to work on browsers without javascript, I have considered how best to
approach applying that ajax UX (if we really want it) to the existing
codebase. The idea that keeps floating to the top is to add an
request.is_ajax() conditional to
mezzanine.pages.views.page and return
the page data as json.
Anyone else have similarly subversive thoughts?
ken
On Sun, Aug 19, 2012 at 11:22 PM, Xiaotian Tan
<
xiaoti...@butterfly.com.au> wrote:
> Hi, I am trying to create a custom content type which support ajax.
>
> The same url should give two template files, one is for normal html page, another is just raw page. I knew I can use request.is_ajax() to verify if the request is an Ajax call or not, but how can I set different template for it?
>
> Do I have to create urls.py to make it happen or use page processors? Could any pro to guild me about this please?