All,
In an attempt to include my navigation menus into another site (the usual methods don’t work for various reasons) I am trying to use the modx API mode to include them directly.
I have a test page with just this code:
<?php
define('MODX_API_MODE', true);
include('/home/xxx/subdomains/pages/index.php');
echo $modx->getChunk("NavigationCanvas");
echo $modx->getLoginUserName();
?>
I get my username correctly, but not the navigation div/list, despite checking the name many times for accuracy.
Does anyone have any ideas? It just quietly returns an empty string.
For some background, the end of all this will enable the modx menus to appear at the top of the page for a vbulletin installation. Initially, I hoped to wrap the whole forum in a modx page, but realised that was a bit optimistic. I’ll settle for calling in elements and writing the templates twice, although my host has include(http://) and fopen turned off, and curl creates database errors in vbulletin for an unknown reason.
Any help will be much appreciated.