We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15921
    • 8 Posts
    Before I jumped in and submitted this to JIRA, I wanted to see if I was doing things the right way. I’m using MODx Revolution 2.0.0-pl rev7212, PHP 5.2.9, and Apache/2.2.10.

    I have created an error page which uses a template that has a few TVs that I’ve populated. When I preview this page, the TVs load and the correct information displays. I also have this page set as the system error page. When I access a page on my site that I know does not exist, this error page also displays properly.

    However, in a custom snippet I have the following code that does display the error page but DOES NOT load the template variables for that page:

    if(is_null($code)) {
    	$modx->sendErrorPage();
    	return "";
    }
    


    Basically this code is checking to see if a URL parameter exists. If not, I wish to display a 404.

    Am I making that call properly, or is there a better way to go about what I’m doing?

    Thanks