Hey Matt,
To create the link, you need to add a rule to Director and a menu item to LeftAndMain. In your _config.php, add the following lines:
LeftAndMain::add_menu_item(
'intranet',
_t('LeftAndMain.INTRANET','Intranet'), // just in case you want to translate it!
'intranet',
'IntranetPlanel'
);
Director::addRules(100, array(
'intranet/$Action' => 'IntranetPanel',
));
In your code directory, create a new file "IntranetPanel.php" and save the following code:
class IntranetPanel extends LeftAndMain {
public function init() {
parent::init();
}
public function Link($action = null) {
return "intranet/$action";
}
}
Finally you need to make a few templates.
Create a new empty file "IntranetPanel_right.ss" and place it in your Includes directory. It will contain your iframe, which you will need to style. For example:
<iframe style="width: 100%; height: 100%;" src="http://intranet/"></iframe>
Copy LeftAndMain.ss to your templates directory and rename it "IntranetPanel.ss".
Since we don't need a left tree element, remove the line:
<div id="left" style="float:left">
$Left
</div>
Finally, modify the div with the id 'right' to read:
<div class="right" style="width: 98%" id="right">
$Right
</div>
(note, prefer to avoid the inline styling, but it demonstrates the point). This just makes our panel fill the whole space.
Flush your site and presto, one Intranet link that displays any page you like in a custom frame.
I've tested it out and it works a treat.
Some improvements you could make: have the URL to the iframe page as a property of the IntranetPanel class, or generalise it even further into an external page panel class. Probably fix up the styling so you don't have messy in-line stuff.