We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    I recently needed to stop phx from parsing text/javascript media types.

    here’s the solution. Please consider integrating it

    
    /*####
    #
    #	Name: PHx (Placeholders Xtended)
    #	Version: 2.1.3
    #	Author: Armand "bS" Pondman ([email protected])
    #	Date: July 13, 2007
    #   
    #	Update to disable phx parsing for specified media types.
    #		- update the phx plugin with this file
    #		- add to the configuration string:  &disableFor=Disable for Internet Media Types;string;text/javascript
    #		- modify or add values like: text/javascript,text/css
    #
    ####*/
    
    include_once $modx->config['rb_base_dir'] . "plugins/phx/phx.parser.class.inc.php";
    $e = &$modx->Event;
    $PHx = new PHxParser($phxdebug,$phxmaxpass);
    
    switch($e->name) {
    	case 'OnParseDocument':
    		
    		$aDisableFor = explode(',',$disableFor);
    		//disable phx parsing for specified file types
    		if ( !in_array( $modx->documentObject['contentType'], $aDisableFor) ){
    			$PHx->OnParseDocument();
    		}
    		
    		break;
    }