Community

write new page without default page template around it

Hi, I'm trying to write a page so I can display my custom content without the default page template around it. I was able to achieve it with the below code but all the default drupal js and css header have also disappeared.
As I'm including the user login form in the new template I will still need all the drupal js/css for it to work.

How would I make the form work with the normal validation in the new template, or should I try other alternatives?

mymodule.module

function MYMODULE_menu()
{
$items['test'] = array(
        'page callback' => 'test_page',
        'access arguments' => array('access content'),
        'title' => t('test Login'),
        );
       
    return $items;
}

function test_page()
{
    $content['data1'] = 'test text';
    $content['formoutput'] = (drupal_get_form('user_login'));
   
    //return theme('test_page', $content);
    print theme('test_page', $content);
    exit();
}

function MYMODULE_theme($existing, $type, $theme, $path)
{
return array(
                    'test_page' => array(
                        'variables' => array('content' => NULL),
                        'template'  => 'page--test',
                        'path' => drupal_get_path('module', 'MYMODULE')
                        ),
                    );
}

in MYMODULE folder, page--test.tpl.php

<?php
print $variables['data1'];
print
drupal_render($variables['formoutput']);
?>

Everything was printed as plain text with no default styling like I hoped but I would still like to have the default drupal headings with js and css for the form to work. Please help.

Comments

I haven't read your post but

I haven't read your post but its title. Change delivery callback of your menu item in hook_menu.
Read hook_menu documentation about delivery callback.

nobody click here