Share » Forums » Developer » Missing template-output in custom...

Missing template-output in custom datatype

Missing template-output in custom datatype

Thursday 12 January 2006 1:48:20 am - 5 replies

Author Message

Hans Melis

Thursday 12 January 2006 1:58:50 am

Hi Felix,

1) Does the template actually exist?

2) If it does, have you cleared the template override cache?

Hans
http://blog.hansmelis.be

Felix Laate

Thursday 12 January 2006 2:23:09 am

Hi Hans,

Thank you for your answer!

I have the files:

extension/colorpicker/design/standard/templates/content/datatype/edit/ezcolorpickertype.tpl
extension/colorpicker/design/standard/templates/content/datatype/view/ezcolorpickertype.tpl

And I have cleared all caches.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Hans Melis

Thursday 12 January 2006 2:27:27 am

The templates should have the name of the datatype, not its class name. In your case, just name them <b>ezcolorpicker.tpl</b> (thus without <i>type</i>)

Edit: and clear the template override cache again after the rename just to be sure

Hopefully that solves it ;-)

Hans
http://blog.hansmelis.be

Felix Laate

Thursday 12 January 2006 3:19:12 am

Hi again,

I changed the filenames and cleared all the cache, but it still won't work.

This my php-code:

<?php   

// 
// ezcolorpicker DataType
//
//

// Include the super class file 
include_once( "kernel/classes/ezdatatype.php" );   

// Define the name of datatype string 
define( "EZ_DATATYPESTRING_COLORPICKER", "ezcolorpickertype" );   

class eZColorPickerType extends eZDataType {    

function eZColorPickerType()    {        
	$this->eZDataType( EZ_DATATYPESTRING_COLORPICKER, "Colorpicker" );    
}      

function fetchObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute ) {
	if ( $http->hasPostVariable( $base . "_data_text_" . $contentObjectAttribute->attribute( "id" ) ) ) {
		$data =& $http->postVariable( $base . "_data_text_" . $contentObjectAttribute->attribute( "id" ));
		$contentObjectAttribute->setAttribute( "data_text", $data );
	}        
	return true;    
}      

function storeObjectAttribute( &$contentObjectattribute ) {    
}     

function &objectAttributeContent( &$contentObjectAttribute ) {        
 	return $contentObjectAttribute->attribute( "data_text" ); 
}      

function metaData( $contentObjectAttribute ) {        
	return $contentObjectAttribute->attribute( "data_text" ); 
}      

function title( &$contentObjectAttribute ) {        
	return $contentObjectAttribute->attribute( "data_text" );  
} 

}   

eZDataType::register( EZ_DATATYPESTRING_COLORPICKER, "ezcolorpickertype" ); 

?> 

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Felix Laate

Thursday 12 January 2006 6:47:46 am

Hans,

I figured it out.. or rather I didn't. I redid the whole thing, and then it worked.

Thank you for your advices!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu