Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

Me again with the noob question.
I want to achieve this:
At the url http://ROOT/something/{numeric_id_here} to get a page that lists the header and the footer of the theme and my custom content. The content is not manage-able through the admin. It depends on the numeric id.
Here is what I got so far.
I use the hook_menu for this:

function something_menu() {
    $items['something/%id_here'] = array(
        'title' => 'Some title',
        'type' => MENU_NORMAL_ITEM,
    );
    return $items;
}

I have the function that parses the url and gets the numerical value:

function id_here_load($arg) {
    $data = get my custom data from an external xml feed based on $arg; //this works nicelly - I get an array with the data I need.
    //WHAT'S NEXT?
}

Now I'm stuck. how can I pass $data to a template and render that template in the content of the page?
My question is somehow similar to this onethis one. Just that the answers provided there don't cut it for me.

Me again with the noob question.
I want to achieve this:
At the url http://ROOT/something/{numeric_id_here} to get a page that lists the header and the footer of the theme and my custom content. The content is not manage-able through the admin. It depends on the numeric id.
Here is what I got so far.
I use the hook_menu for this:

function something_menu() {
    $items['something/%id_here'] = array(
        'title' => 'Some title',
        'type' => MENU_NORMAL_ITEM,
    );
    return $items;
}

I have the function that parses the url and gets the numerical value:

function id_here_load($arg) {
    $data = get my custom data from an external xml feed based on $arg; //this works nicelly - I get an array with the data I need.
    //WHAT'S NEXT?
}

Now I'm stuck. how can I pass $data to a template and render that template in the content of the page?
My question is somehow similar to this one. Just that the answers provided there don't cut it for me.

Me again with the noob question.
I want to achieve this:
At the url http://ROOT/something/{numeric_id_here} to get a page that lists the header and the footer of the theme and my custom content. The content is not manage-able through the admin. It depends on the numeric id.
Here is what I got so far.
I use the hook_menu for this:

function something_menu() {
    $items['something/%id_here'] = array(
        'title' => 'Some title',
        'type' => MENU_NORMAL_ITEM,
    );
    return $items;
}

I have the function that parses the url and gets the numerical value:

function id_here_load($arg) {
    $data = get my custom data from an external xml feed based on $arg; //this works nicelly - I get an array with the data I need.
    //WHAT'S NEXT?
}

Now I'm stuck. how can I pass $data to a template and render that template in the content of the page?
My question is somehow similar to this one. Just that the answers provided there don't cut it for me.

Tweeted twitter.com/#!/StackDrupal/status/538000145317904384
Source Link
Marius
  • 119
  • 7

Custom page with fixed content

Me again with the noob question.
I want to achieve this:
At the url http://ROOT/something/{numeric_id_here} to get a page that lists the header and the footer of the theme and my custom content. The content is not manage-able through the admin. It depends on the numeric id.
Here is what I got so far.
I use the hook_menu for this:

function something_menu() {
    $items['something/%id_here'] = array(
        'title' => 'Some title',
        'type' => MENU_NORMAL_ITEM,
    );
    return $items;
}

I have the function that parses the url and gets the numerical value:

function id_here_load($arg) {
    $data = get my custom data from an external xml feed based on $arg; //this works nicelly - I get an array with the data I need.
    //WHAT'S NEXT?
}

Now I'm stuck. how can I pass $data to a template and render that template in the content of the page?
My question is somehow similar to this one. Just that the answers provided there don't cut it for me.