Hi,

I am using the thickbox module in drupal. The type I am using is the AJAX request via thickbox and I am passing the URL to get only the 'content'.

How can I show only the returned content without the primary links and other stuff like sidebar in drupal? Right now, the thickbox also returns the primary links.

This is the URL that I am passing: http://cec5/bhutan/?q=en/ceccr/subscribe/59&destination=og

I need only to get the 'returned content' from the return_me function. For example, my code is:

function cec_mypage_menu($may_cache) {
    $items = array();
    $items[] = array(
        'path' => 'cec_mypage',
        'title' => t('CEC My Page'),
        'access' => TRUE,
        'callback' => 'return_me',
        'type' => MENU_CALLBACK,
    );
    return $items;
}

function return_me() {
    return 'Only return this text and nothing more. No primary links, other layouts and stuff.<br />';
}

How can I do that?

Thanks in advance.

Cheers,
Mark

Comments

dman’s picture

Short answer - don't return. When there is a return value it gets wrapped in the page template.

function return_me() {
    print 'Only return this text and nothing more. No primary links, other layouts and stuff.<br />';
    exit();
}

... there's actually more to it than that if you need to do things like closures (?) so have a look at how, for example, the rss feeds return their content. It used to be about that easy, but there may be more things involved in some cases.

marknt15’s picture

Thanks dan for the fast answer :)
I will try it now