Recent Topics

GetHandledDispModes() Help please

Started by on Nov 10, 2013 – Contents updated: Nov 11, 2013

Nov 10, 2013 11:21    

Can you please point me to where the manual provides info on how to use this? or give me direction.
this is what I have:



	/**
	 * Return list of custom disp types handled by this plugin
	 *
	 * @return array list of disp modes handled by this plugin
	 */
	function GetHandledDispModes()
	{
		return array(
				'disp_test', // display our test disp
			);
	}


	/**
	 * Display our custom disp mode(s)
	 *
	 * @param mixed array $params
	 * 		disp > display mode requested
	 *
	 * @return did we display?
	 */
	function HandleDispMode( $params )
	{
		echo '<p>This is the test plugin handling the ['.$params['disp'].'] disp mode.</p>';
	}

this is how I implemented it:



	/**
	 * Return list of custom disp types handled by this plugin
	 *
	 * @return array list of disp modes handled by this plugin
	 */
	function GetHandledDispModes()
	{
		return array(
				'disp_test', // display our test disp
			);
	}


	/**
	 * Display our custom disp mode(s)
	 *
	 * @param mixed array $params
	 * 		disp > display mode requested
	 *
	 * @return did we display?
	 */
	function HandleDispMode( $params )
	{
		include '_test.disp.php';
	}

surely there is a better way of doing this?

Nov 11, 2013 22:17

function GetHandledDispModes()
{
	return array(
			'info',
		);
}


function HandleDispMode( $params )
{
	if( $params['disp'] == 'info' )
	{
		echo 'My Info page';
	}
}

View your info page

http://b2evoblog/?disp=info

Nov 11, 2013 22:37

Thanks, I got that. What I actually want is to point it to the disp file:

	
//_test.disp.php

the only way I get it to to work is with

include '_test.disp.php';

shouldn't it instead be something like:

$disp_handlers = array( 'disp_test' => '_test.disp.php',  ); 

Nov 11, 2013 23:27

SOLVED:
copy _test.disp.php to skins folder:


	function GetHandledDispModes()
	{
		return array(
				'disp_test'  // display our test disp
			);

	}



	
	function HandleDispMode( $params )
	{
		
		return skin_include( '$disp$', array(
	       'disp_test'  => '_test.disp.php',
	     ) );
	}

Thanks @mgsolipa and @sam2kb


Form is loading...

Forums software – This forum is powered by b2evolution CMS, a complete engine for your website.