How to set up a non translatable datatype ?

Author Message

Jerome Despatis

Monday 09 November 2009 7:39:08 am

Hi

I'm coding a datatype, but it contains only specfic data, and i don't want the user to be able to set different values for different languages for this datatype.

In fact, i'd like that any attribute with this datatype to be untranslatable.

I can, of course, set it in the admin interface, but is it possible to set it directly in the datatype class ?

i've tried, the following code in my datatype constructor:

$this->eZDataType(self::DATA_TYPE_STRING, "Extension..", array('translation_allowed' => false));

It shows in the interface the language is disabled for this attribute, so it seems to work, but NOT!

in the ezcontentclass_attribute, i can see for this attribute that the fied 'can_translate' is at 1, and not 0

Any idea is welcome

Romain Petit

Wednesday 11 November 2009 2:43:23 pm

Hi,

In your datatype's "edit" template :

{if eq($attribute.object.initial_language_code,$attribute.language_code)}

inputs... etc....

{else}

nothing, your not in the initial language

{/if}

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:45:29
Script start
Timing: Jan 18 2025 02:45:29
Module start 'layout'
Timing: Jan 18 2025 02:45:29
Module start 'content'
Timing: Jan 18 2025 02:45:30
Module end 'content'
Timing: Jan 18 2025 02:45:30
Script end

Main resources:

Total runtime0.6849 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1641152.6406
Module start 'layout' 0.00550.0022 741.804739.4766
Module start 'content' 0.00770.6757 781.2813456.7656
Module end 'content' 0.68340.0014 1,238.04698.1250
Script end 0.6848  1,246.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4837160.0002
Check MTime0.00140.2007160.0001
Mysql Total
Database connection0.00080.119310.0008
Mysqli_queries0.643293.9201540.0119
Looping result0.00050.0729520.0000
Template Total0.657195.920.3285
Template load0.00220.321820.0011
Template processing0.654995.621420.3274
Template load and register function0.00010.021710.0001
states
state_id_array0.00070.103110.0007
state_identifier_array0.00090.133820.0005
Override
Cache load0.00180.2660200.0001
Sytem overhead
Fetch class attribute can translate value0.00080.118920.0004
Fetch class attribute name0.00110.153620.0005
XML
Image XML parsing0.00030.039120.0001
class_abstraction
Instantiating content class attribute0.00000.001120.0000
General
dbfile0.00070.0969100.0001
String conversion0.00000.001040.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs