Check nodes translations

Author Message

Tobias Persson

Thursday 22 January 2004 1:36:54 am

Hi,

I am trying to convert a site that has 5 different languages and partially the same content to EZ.

But I need a way to just show the content that has been translated on each site. Ie if I have created product1 on english and it hasn't been translated to swedish yet, I don't want to show it on the swedish site.

Is this possible to do in some easy way, or do I have to check the language_list for every node?

Balazs Halasy

Thursday 22 January 2004 2:44:39 am

Currently eZ publish will display the default language version of the content object - in other words, if Swedish is the default language and an English translation doesn't exist then it WILL display the Swedish one. This is a bit unfortunate and I think it will be replaced by some alternate functionality in the future (has been discussed on the internal developer mailing list). However, you could do some trick in your template: check which language it is and display something else if it is not the correct language, etc.

Balazs

Tobias Persson

Thursday 22 January 2004 3:01:27 am

Thanks for the quick reply :)

I will do like this for now then.

{let ThisLang=$node.object.default_language}

{section name=Lang loop=$node.contentobject_version_object.language_list}
{switch name=Sw1 match=$ThisLang}
{case match=$Lang:item.language_code}

{* output stuff *}

{/case}
{switch}
{/section}

{/let}

/Tobbe

Heiner Wurbs

Tuesday 24 January 2006 3:33:24 am

this is fine and fast, use in the fetch statement the only_translated parameter, like:

fetch(content, list, hash(parent_node_id, $node.node_id, only_translated, true() ) )  

Cheers,
Heiner

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 19 2025 06:12:54
Script start
Timing: Jan 19 2025 06:12:54
Module start 'layout'
Timing: Jan 19 2025 06:12:54
Module start 'content'
Timing: Jan 19 2025 06:12:55
Module end 'content'
Timing: Jan 19 2025 06:12:55
Script end

Main resources:

Total runtime0.8329 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1563152.6250
Module start 'layout' 0.00460.0024 741.781339.4453
Module start 'content' 0.00700.8244 781.2266560.8047
Module end 'content' 0.83130.0016 1,342.031312.1641
Script end 0.8329  1,354.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3728160.0002
Check MTime0.00130.1507160.0001
Mysql Total
Database connection0.00070.083810.0007
Mysqli_queries0.774793.0113620.0125
Looping result0.00060.0759600.0000
Template Total0.803096.420.4015
Template load0.00220.267120.0011
Template processing0.800896.137720.4004
Template load and register function0.00010.014210.0001
states
state_id_array0.00070.083410.0007
state_identifier_array0.00140.166020.0007
Override
Cache load0.00190.2264310.0001
Sytem overhead
Fetch class attribute can translate value0.00080.097730.0003
Fetch class attribute name0.00270.327060.0005
XML
Image XML parsing0.00120.143430.0004
class_abstraction
Instantiating content class attribute0.00000.001770.0000
General
dbfile0.00130.1591220.0001
String conversion0.00000.000940.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs