I want to include an external php script or modx snippet to the index.php
but it causes the blank screen
instead (and no document parser errors). Probably the problem is that this script i want to include contains starting session
functions and set_include_path
function that might somehow conflict with Modx parser.. I tried to use the Modx API but it doesn't seem to work. I use Modx 0.9.2.6 yet..
How can I overcome the issue?
My script checks the session and database if the user is logged-in on the site (logging system is not modx-based) and then prints the menu depends on the user privileges...
This is what I put in the beginning of the index page template: [[modx_api_supernav]]
The code of the snippet modx_api_supernav:
<?php
$path = dirname(__FILE__).'/';
include_once($path.'modxapi.php'); //last release of Modx API file located in the root
$modx = new MODxAPI();
$modx->connect();
$modx->startSession();
$modx->runSnippet('supernav'); //snippet that contains external Zend Framework code
?>