I am trying to upload an image in my template page, using jquery ajax-form submit.
And i am returning just the image name after it is uploaded in the module function. However, i am getting the entire html as response.
In my theme's template.php, i have used the following code:
function my_theme_preprocess_page(&$vars) {
if ( isset($_GET['ajax']) && $_GET['ajax'] == 1 ) {
$vars['template_file'] = 'page-ajax';
}
}
I have this code in my theme's page-ajax.tpl.php: <?php print $content; ?>
And i am passing the 'ajax=1' parameter to the module hook menu function that handles the image upload. How can i just output the image name in ajax response, instead of the entire html.tpl.php?