Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Hey
Can anyone here guide me on AJAX-ifying a simple couch cms blog. The blog is similar to the tutorial blog and very simple. Any help would be much appreciated. :D
Cheers!
Hello :)

I think you should find the following thread useful -
viewtopic.php?f=8&t=8440

Do let us know if it helps.
I had taken a dive into that code earlier. But what I am trying to achieve is when the user clicks on one of the links in list view, it should load that post using AJAX and if he were to return back, load the list view using ajax.
Any help would be appreciated :D
There can be several ways of implementing that functionality.
One could be that you use JQuery to make the links in the existing design invoke a JS function where you then make the AJAX call to the server (i.e. Couch) and get the results back to display.

What I mentioned above is staple AJAX stuff and you are free to use whatever technique suits you. I'll only elaborate on the server side code that you'll call using AJAX.

On the server-side, we can call your existing blog template to return back the results.
Of course, the HTML returned via AJAX should contain only selected portion of the entire page (e.g. should skip the header, footer, sidebar etc.).

To do that, please see the following post -
viewtopic.php?p=18342#p18342

It'll will give you a tag named cms:is_ajax.
You can use it in your existing blog template (both in list-view as well as page-view) to figure out whether the template is being invoked via AJAX and then return only the relevant markup
Code: Select all
<cms:if "<cms:is_ajax />">
    ..
</cms:if>

Do you think this would help?
Please let me know.
If you are not on good terms with JS :D , maybe this can help a bit. Super simple AJAX calls done via HTML attributes.

http://intercoolerjs.org/
Thank you for sharing the link, @madebym. It looks very useful indeed.
Thanks guys! :) :)
7 posts Page 1 of 1
cron