Shoehorning in external php
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.
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.
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"); ?>