#1 June 24, 2014 9:51am

jmason03
Member
Registered: January 9, 2014
Posts: 123

Access BigTree variables outside of CMS Pages

I have some files that I can't run through BigTree but I would like to have access to the variables/functions so that I can include my standard _header.php file without having to write a separate one that doesn't use BigTree. Are there specific files that I need to include on my outside files so that it can instantiate the necessary classes and functions?

Thanks

Offline

#2 June 24, 2014 11:23am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Access BigTree variables outside of CMS Pages

If you want to bootstrap BigTree's environment from an outside file you can do so by setting the $server_root variable and including core/bootstrap.php.

For example, if we had the file /site/blog/index.php and wanted to include BigTree's environment:
<?
    $server_root = str_replace("site/blog/index.php","",__FILE__);
    include $server_root."custom/settings.php";
    include $server_root."custom/environment.php";
    include $server_root."core/bootstrap.php";
?>

After that you should be able to include your standard header. If you're still using /templates/config.php for your settings include that instead of settings/environment.

Offline

#3 June 24, 2014 3:40pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: Access BigTree variables outside of CMS Pages

That worked great!

Thanks

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.