I have a PHP page that works great when it is opened as a static web page (outside ModX). But if I try to put the page code into ModX, it doesn’t work. I think it might have to do with an include statement (or a wrong path) that is used at the top of the page - but what the heck do I know?
I think this is a $100 problem but am definitely prepared to pay more if I can be convinced it’s necessary. Right now, I just want to get it to work and need somebody who is very conversant in PHP AND very familiar with ModX. I believe it will be an easy fix for those who know their stuff.
Thanks!
Rick
You need to put the PHP code in a snippet, if you haven’t already.
For includes, you need to prepend MODX_BASE_PATH.
require_once MODX_BASE_PATH . 'path_to_file';
Depending on what the code does, sometimes you need this instead:
return require_once MODX_BASE_PATH . 'path_to_file';
See also the "Porting your site to MODx" page at the site in my sig. (which takes donations, BTW, although $100 is too much).