Displaying a Drupal view without a page template around it

Posted by Ramesh Singh | Updated on

In this example, I have shared how to displaying a Drupal view without a page template around it.I was looking for a way to pull node data via ajax and came up with the following solution for Drupal 6. After implementing the changes below, if you add ajax=1 in the URL (e.g. mysite.com/node/1?ajax=1), you’ll get just the content and no page layout.

Add the below code in your template.php file for your theme:

Then create page-ajax.tpl.php file in your theme directory with this content:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers