Hello, I'm interested in getting my drupal setup to load MENU_LOCAL_TASKs via ajax without re-loading the entire page.

I can add the jQuery javascript to send the page load request, and do a nice little fade out - loading - fade in animation on clicking on the local menu item links. But then I need the response from drupal to just be for the body content, not the entire page... And it's not always a node, it's usually some other menu callback or something. I'm not sure if the body load can be done without editing core, as it seems I'd have to intercept all menu requests and just get the content out...

I could add /ajaxload to the beginning of the uri ... so that /user/password became /ajaxload/user/password then I could use the ajaxload function to find it's own way to the content at user/password but how to do that? That's where I get stuck. Is there some menu_invoke function or something? I could find one in the api. Could we write one? Any ideas?

Thanks for any help you can give me. I think ajax page loads for all local menu items could be really cool and benefit the whole drupal community.

Cheers,
Jamie.

Comments

JamieR’s picture

That should read, "I *couldn't* find one in the api." Perhaps that's why no one was responding my post... ;)

SamSound’s picture

Did anything get done on this, on most of my pages its only the content area that changes, and the blocks, menus etc, stay the same. So it would be useful if I could just load the content area.

skks’s picture

I'm interested in this too. I tried using ajax_tabs with ajax_load, but that doesn't work. Dunno what I'm doing wrong. Does anybody have any clues about that?

ludo1960’s picture

Subscribing..

luxigo’s picture

You can bind an onclick function to the menu links, loading the page in a hidden iframe, and returning false to disable the default link behaviour. Then you can copy what you need from the iframe.