Custom datatype

Author Message

Ivan Švogor

Saturday 09 October 2010 6:42:18 am

Hello,
I'm having trouble creating a custom datatype. I create the right file structure, ini files, templates but it doesn't show in the dropdown when creating class attributes.
The main datatype class is developed by RAD option in administrator panel, and in my tpl files I simply added <b>Hello world</b>... I thought when this shows up, I will proceed from this point to some data collecting and processing, but I can't get it done.
Is the RAD created php file sufficient? - also, the simple tpl file which is supposed to say hello world? - the documentation for new datatypes is awful...

Thiago Campos Viana

Saturday 09 October 2010 8:37:38 pm

I have created a sample user exp datatype that you can check and build your own datatype ( just ignore the modules folder and modules settings ) , you can also check the tutorial about creating datatypes in ez 4.

The main problem is create the extension directory structure, the settings, and design files.

Remember to create all the necessary settings files in your extension settings folder.

You can always check some of the default datatypes code in the kernel/classes/datatypes folder.

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Jérôme Vieilledent

Monday 11 October 2010 12:23:25 am

Hello

I'm currently working on an updated and comprehenseive tutorial about datatype development. But this is a long job...

As Thiago mentioned, check the tutorial Creating datatypes in eZ Publish 4. You might skip the validation steps with UserInput component to be easier to apprehend for a start.

You can also ask questions on the forum if you're lost :)

Marko Žmak

Monday 11 October 2010 1:46:47 am

"

Hello,
I'm having trouble creating a custom datatype. I create the right file structure, ini files, templates but it doesn't show in the dropdown when creating class attributes.
The main datatype class is developed by RAD option in administrator panel, and in my tpl files I simply added <b>Hello world</b>... I thought when this shows up, I will proceed from this point to some data collecting and processing, but I can't get it done.
Is the RAD created php file sufficient? - also, the simple tpl file which is supposed to say hello world? - the documentation for new datatypes is awful...

"

Hi Ivan, some basic things to check:

1) Did you enable the extension (in the override of site.ini) that declares this datatype?

2) Did you set the proper settings in override of content.ini:

[DataTypeSettings]
ExtensionDirectories[]=your_extension_directory
AvailableDataTypes[]=your_datatype

?

3) Did you clear the cache?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Ivan Švogor

Thursday 14 October 2010 2:38:33 am

"

I have created a sample user exp datatype ( I will change this link to the projects site ) that you can check and build your own datatype ( just ignore the modules folder and modules settings ) , you can also check the tutorial about creating datatypes in ez 4.

The main problem is create the extension directory structure, the settings, and design files.

Remember to create all the necessary settings files in your extension settings folder.

You can always check some of the default datatypes code in the kernel/classes/datatypes folder.

"

Thank you very much, this helped a lot.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:59:49
Script start
Timing: Jan 18 2025 02:59:49
Module start 'layout'
Timing: Jan 18 2025 02:59:49
Module start 'content'
Timing: Jan 18 2025 02:59:50
Module end 'content'
Timing: Jan 18 2025 02:59:50
Script end

Main resources:

Total runtime0.6549 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.9063152.6094
Module start 'layout' 0.00590.0034 741.515639.4219
Module start 'content' 0.00940.6439 780.9375667.9063
Module end 'content' 0.65330.0015 1,448.843816.1953
Script end 0.6548  1,465.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5400160.0002
Check MTime0.00130.1998160.0001
Mysql Total
Database connection0.00080.128110.0008
Mysqli_queries0.583289.0538690.0085
Looping result0.00080.1183670.0000
Template Total0.612693.520.3063
Template load0.00220.332320.0011
Template processing0.610493.207420.3052
Template load and register function0.00030.039710.0003
states
state_id_array0.00130.204510.0013
state_identifier_array0.00100.149520.0005
Override
Cache load0.00200.3049450.0000
Sytem overhead
Fetch class attribute can translate value0.00110.165240.0003
Fetch class attribute name0.00190.285180.0002
XML
Image XML parsing0.00160.249840.0004
class_abstraction
Instantiating content class attribute0.00000.002880.0000
General
dbfile0.00540.8315310.0002
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 10

Time used to render debug report: 0.0002 secs