Shoehorning in external php

Permalink
On my present site I have a few areas that have rather extensive php running a few rather key areas of my site. For the most part, these are self-contained so I do not mind if I cannot control them via the CMS.

What I would like to do, is integrate them visually with the site. Is there a preferred method for this?

I'd really like to be able to make a few blocks with the php for some of the functions (which, on my present site, just uses includes) - I tried just using an include, and that did not work. Can I make a block that contains php? or just html? Or... can I make it so that it can contain php?

For the big pages though, my present idea is to simply have them include the header/footer from my theme. Is there a better way to do this? Also can I modify the header and footer to have includes? Since it looks like standard php.. what I did before was make a menu.php file and include that for the main nav.. would that work in this instance? can I make it so that the pages that aren't inside the CMS can understand the CMS commands?

I hope this makes some sense.

lisbokt
 
Mnkras replied on at Permalink Reply
Mnkras
have you tried iframes? there is a free block in the marketplace for them,
ijessup replied on at Permalink Reply
ijessup
I could think of 2 ways.

The prefered way would be to turn your code into a block.

The possibly easy way would be to use the external form block. However, this could get hariy if your code relies on multiple php files.
ijessup replied on at Permalink Reply
ijessup
Sorry, I should have been more clear when I said make your code a block.

When you create your block, add a folder named "code" for example. When you include any files, just reference the file based on its relationship to the block.

Code for when out side of the blocks view.php file provided by ChadStrat:
<?php   
$uh = Loader::helper('concrete/urls'); 
$bt = BlockType::getByHandle('your_block'); 
$local = $uh->getBlockTypeAssetsURL($bt);  
 ?>

Code when inside view.php file:
<?php
$local = $this->getBlockPath();
?>

To include your code:
<?php
include($local."/code/file.php"); 
?>