I am planning on running outside classifieds software side by side with my MODx installation. Intead of using an iFrame for this software, I am thinking of putting the classifieds in a folder on the server and running it all by itself (separate from MODx). So that I can get the SEO benefit as well. Frankly, sometimes iFrames just suck which is why I don't want to use it to contain so many pages of a classifieds site.
So I would install MODx in the root, and create another folder in the root called: classifieds. Inside the classifieds/ folder I would have the classifieds software running by itself.
My largest challenge is updating separate navigation menus for both areas, when I only want the menu from MODx to control both. Is it possible to use my header, navigation, and footer chunk from my MODx and apply it to my other installation. Something like an include. So the classifieds would take the header, navigation, and footer chunk and populate it with the MODx settings? This way I would only have to keep up with the MODx navigation menu, instead of duplicating it each time on the classifieds installation. The reason I think this could be possible is because the classifieds software site runs PHP like MODx.
Or am I stuck with a stinking iFRame? Advice please.
That's a complicated problem. I think what I would do is make them all chunks. Then in the other app, I'd instantiate the $modx object so they could be retrieved in PHP with $modx->getChunk().
Inside MODX, the links to the other app would have to be weblinks, and I think you'd have to mess with the FURL rewrite rules in .HTACCESS to keep MODX from processing them.
Initializing the $modx object, in its simplest form, looks like this:
define(MODX_CORE_PATH, 'actual/path/to/modx/core');
require_once MODX_CORE_PATH . '/model/modx/modx.class.php';
$modx = new modX();
if (!$modx) {
die('Could not create MODX class');
}
$modx->initialize('web');
$modx->getService('error', 'error.modError', '', '');
Thank you Bob Ray. I know there is a reason and a need for iFrames and I do use them, sometimes they are not the answer. Given my php skills, I think I just might have to use an iFrame in this case.
When I compare the work of keeping up with 2 templates over the benefit of SEO, then I think it makes sense to use the iFrame in this case.
Once again I do appreciate your work.
Patrick
-
☆ A M B ☆
- 894 Posts
I'm no PHP pro and I don't know if this is even possible but why don't you try putting the classified folder inside the MODX installation and try to use the classified page as a static resource in MODX?
Like I said don't get too excited I'm not sure if it would work but it might be worth a try, perhaps Bob can say why this might not be a good idea and/or if it will work.
It's difficult to give suggestions without knowing a lot more about the other application.
BTW, I've put up a more complete post on using MODX outside of MODX here:
http://bobsguides.com/blog.html/2013/07/13/using-modx-outside-of-modx/
The MODx outside of MODx post is impressive. I may end up trying that some time. Thank you BobRay.