Q:

How to create a blank page (external page) in Magento in code with a specific magento template applied to it

Not sure on the best way to go around this and am looking for solutions.  I have the requirement to create a blank page (that I will later add code to) with a specific theme as the design.  I've created the custom theme at: /app/design/frontend/indigo/mytheme/ and need to know how to create a page lets call it /test.php that has the theme applied to it. 
Code so far is this, but this only shows the default theme:
<? php
define('MAGENTO_ROOT', $_SERVER['DOCUMENT_ROOT']);
$mageFilename = MAGENTO_ROOT . ' /app/Mage.php';
if (! file_exists($mageFilename)) {
    echo $mageFilename."  was not found";
    exit;
}
require_once $mageFilename;

Mage::app()->loadArea('frontend');
$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default'); 
$layout->generateXml()->generateBlocks();

//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
$footerBlock = $layout->getBlock('footer');

echo $headBlock->toHtml() .  $headerBlock->toHtml();
? >
My content goes here
<? php
echo $footerBlock->toHtml();
? >

A:

The solution is quite basic, you just need to set the store ID:
Mage::app()->setCurrentStore(STORE_ID);

So the final code looks like this:
<? php
define('MAGENTO_ROOT', $_SERVER['DOCUMENT_ROOT']);
define('STORE_ID', 15);
$mageFilename = MAGENTO_ROOT . ' /app/Mage.php';
if (! file_exists($mageFilename)) {
    echo $mageFilename."  was not found";
    exit;
}
require_once $mageFilename;

Mage::app()->setCurrentStore(STORE_ID);
Mage::app()->loadArea('frontend');
$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default'); 
$layout->generateXml()->generateBlocks();
? >
<! DOCTYPE html>
<html lang="en">
<head>
<? php echo $layout->getBlock('head')->toHtml() ? >
</head>
<body>
<? php echo $layout->getBlock('after_body_start')->toHtml() ? >
<? php echo $layout->getBlock('global_notices')->toHtml() ? >
<? php echo $layout->getBlock('header')->toHtml() ? >
<div class="content-wrapper">
    <div class="container_12">
        <? php echo $layout->getBlock('breadcrumbs')->toHtml() ? >
        <div class="main-container col1-layout">
            <div class="grid_12 col-main">
                <? php echo $layout->getBlock('global_messages')->toHtml() ? >
                <? php echo $layout->getBlock('content')->toHtml() ? >
                My content goes here
            </div>
            <div class="clear"></div>
        </div>    
    </div>
</div>
<? php echo $layout->getBlock('footer')->toHtml() ? >
</body>
</html>

