Wednesday 24 February 2010 11:45:46 am
Hi There. We need a specific issue for our project. Functionality is almost entirely provided by ezflow with ezpagetype, but we need some specific things to be added. So, we thought to build our customezpage datatype. But instead of copying ezpagetype and modifying the necessary we thought about extending eZPageType class. So, we have now something like
class customEZPageType extends eZPageType
{
const DATA_TYPE_STRING = 'customezpage';
/**
* Constructor
*
*/
function __construct()
{
parent::__construct( self::DATA_TYPE_STRING, "Custom Layout" );
}
}
eZDataType::register( customEZPageType::DATA_TYPE_STRING, "customezpagetype" ); Seems to work, but there's a annoying thing that can be confusing to users. At datatypes combo while editing class, i have two 'Layout' entries (Layout is the common name given to this datatype, as Block XML or Boolean). I though the reason is the way ezpagetype::__construct works. There you have
function __construct()
{
parent::__construct( self::DATA_TYPE_STRING, "Layout" );
} So, no matter what you do from extended ones, because this construct always sends to datatype 'ezpage' as data_type_string and "layout" as 'common name". Do you think is not good option to extends a provided datatype? I think this could help us doing specificic things wihout having to copy lot of code. Thank you!.
|