Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (15 votes)

46% thumbs up 53% thumbs down

How would you rate this answer?



Thank you for rating this answer.

How can I wrap a page or PHP file into the Interspire Website Publisher layout?

To include PHP code within a Panel, please see this article: http://www.interspire.com/support/kb/questions/478/

If you already have a PHP file or another page that can be changed to be a PHP file, then you can use this method to include your page into the Interspire Website Publisher design.

Place this code at the very top of your php file:

<?php
ob_start('ob_callback');
include(realpath(dirname(__FILE__).'/../init.php'));
$GLOBALS['Content'] = "##CONTENT##";
$GLOBALS["AL_CLASS_TEMPLATE"]->SetPageTitle($GLOBALS["AL_CFG"]["SiteName"]);
$GLOBALS["AL_CLASS_TEMPLATE"]->SetTemplate("Other");
ob_start();
echo $GLOBALS["AL_CLASS_TEMPLATE"]->ParseTemplate();
$template = ob_get_contents();
ob_end_clean();
function ob_callback($tmp) {
    global $template;
    $new = str_replace("##CONTENT##",$tmp,$template);
    return $new;
}
?>


Note: In the code above, you will see this line:

include(realpath(dirname(__FILE__).'/../init.php'));
This is the path to your Interspire Website Publisher init.php file. This specific one is if you are in a sub-directory below it (e.g. Interspire Website Publisher is at www.site.com and your file is at www.site.com/subfolder/). If you were in the same directory it would merely be:

include('init.php');

Or if Interspire Website Publisher is in a subfolder, then:

include(realpath(dirname(__FILE__).'/sub-folder-name/init.php'));
Once you put the code before at the top of the file, it will wrap your content into the Interspire Website Publisher design using the Other.html layout file located in /templates/{your-template}/

If you have any troubles using this method, simply post a support ticket via your client area.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software