Drupal menu_callback item using ajax callback renders full page

It’s pretty annoying when you only want a few variables, rendered nicely on screen with your tpl.php, and you end up getting the entire page when you do an ajax callback to that function. Apparently you need to print/echo whatever you want rendered on the page rather than return it (as you would for a normal menu item).

Which is how I ended up with infinitely nested page instances. Fun!

Leave a Reply