specify context on hook_menu drupal I would like to check if particular node instance exists then load that node. if the instance does not exist, then display message. So far:

function MODULE_menu() {
    $items['ds-some'] = array(
        'title' =&gt; 'Some',
        'page callback' =&gt; 'some_display',
        'access arguments' =&gt; array('access content'),
        'type' =&gt; MENU_NORMAL_ITEM,
        'file' =&gt; 'inc/some.pages.inc',
    );

    return $items;
}

function MODULE_theme(){
    return array(
        'render-some' =&gt; array(
            'template' =&gt; 'page--some',
            'variables' =&gt; array(
                'node' =&gt; NULL
            ),
            'path' =&gt; path_to_theme().'/templates',
        ),
    );
}


in file inc/some.pages.inc

    function some_display(){
            $build = array();

            $nid_some = db_select('node', 'n')
                -&gt;fields('n', array('nid'))
                -&gt;fields('n', array('type'))
                -&gt;condition('n.type', 'SOME_TYPE')
                -&gt;execute()
                -&gt;fetchCol();

            //load first instance 
            $someNode = node_load($nid_some[0]);

            if (!empty($shopNode)) {

//Attempt 1
    //            $build['ds-some'] = array(
    //                '#theme' =&gt; 'node',
    //                '#node' =&gt; $someNode,
    //                '#view_mode' =&gt; 'full',
    //            );

//Attempt 2    
    //            $build['ds-some'] = node_view($someNode, 'full');

                $build['ds-some'] = array(
                    '#theme' =&gt; 'render-some',
                    '#node' =&gt; $someNode,
                );
            }
            else {
                drupal_set_message(t('It appears there is no instance present');
            }
            return $build;
    }


The first two attempts ended with the title of the Node instance but Drupal is no rendering the whole page(template file, views, etc). In my last attempt, i use custom theme function that it works, however. It is not rendering the context for the node type specified. How to specify context when working with hook_menu(), so that the context configured will load blocks and views? Thank you for any help.
I don't know how the Context module handles Entity types, but it loads entity type definitions using the entity ID (from the URL). In your case, you are creating a menu item without any arguments, just specifying business logic in the callback, and your menu item path is not a node path. That's why the Context module can't find any entity type definition. In this case you can specify additional context reactions by path (by your custom path) and display blocks.

You don't need to specify double fields method; you can write much simpler code.

$nid_some = db_select('node', 'n')
  -&gt;fields('n', array('nid', 'type'))
  -&gt;condition('n.type', 'SOME_TYPE')
  -&gt;execute()
  -&gt;fetchAll();


If you need to fetch only one row from the database, you can use the following code.

$nid_some = db_select('node', 'n')
  -&gt;fields('n', array('nid', 'type'))
  -&gt;condition('n.type', 'SOME_TYPE')
  -&gt;range(0,1)
  -&gt;orderBy('nid', 'DESC') // Additional sorting
  -&gt;execute()
  -&gt;fetchAll();