Loading all pages with AJAX

Permalink
What I would really like to see in the c5 core is the ability to switch c5 into a mode where it loaded all pages with AJAX. I.e. when clicking a link which leads to a page of the same page type, instead of loading the new page in its entirety the areas were loaded in AJAX and inserted.

I doubt this would significantly improve performance however it would improve user experience especially on slower and mobile browsers.

However, the real reason I would find it so beneficial is to be able to run continuous JavaScript in the background. For instance I have built this websitehttp://www.colchesterjazzclub.co.uk... - which has background music implemented using HTML5 Audio (3 separate tracks triggered using the header images), however the whole thing resets every time the user changes pages, which makes it largely pointless.

All solutions to this problem involve rewriting large parts of the CMS, and it is not good to see a CMS that prides itself on not limiting the designers imagination to fall short on a point like this which I'm sure will become more poignant over time.

firepixel
 
Mainio replied on at Permalink Reply
Mainio
I think this is extending functionality instead of something that should be in the core.

This can be achieved e.g. with this add-on:
http://www.concrete5.org/marketplace/addons/rapid-ajax-paging/...

Or, by writing a few lines of code and your own tool that will pass the correct area's content dynamically to the javascript.

I did like a year ago a similar music site project and the music player request came late in that project. I didn't want to write a lot again, so I by-passed the issue by letting the users open a small popup-window for the music player so that the music keeps on playing when they change pages. If you're interested seeing that in action, just throw me with a PM.


- Antti
firepixel replied on at Permalink Reply
firepixel
Thanks, I thought of the popup solution but my site gives the user three choices of music which interact with graphic objects, so there would have to be some kind of communication with the popup window, which I believe is impossible in most browsers.

The add-on looks good but I don't have budget for that, especially when I can't make sure it works with my site!
Mainio replied on at Permalink Reply
Mainio
You could setup a cookie and in the player window set a timer that checks e.g. every second whether that cookie is changed...

Yes, that's a bit "hacky" but would give you a workaround for the problem.

But, some kind of ajax framework would probably work better in your case, whether it is self-written or one of the suggested ones.

-Antti
firepixel replied on at Permalink Reply
firepixel
That probably would have been an easier solution with hindsight. Ajax is messy, there are asynchronous loads going on all over the shop! Lightboxes and google maps have taken a lot of messing about to get to work.
Mnkras replied on at Permalink Reply
Mnkras
This has to be done in the theme, attempting to do this in the core would not work, as it is impossible to detect content areas and such.
aghouseh replied on at Permalink Reply
aghouseh
Check this out. I've had some luck with this in C5.

http://gist.github.com/854622
firepixel replied on at Permalink Reply
firepixel
Thanks, that's useful, however c5 loads my block view.css and view.js files in the header, which is then not imported by the AJAXifier. I am trying to modify this code to do so, but I feel like I'm opening Pandora's box...

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.