Multilanguage site mixes contents

Author Message

Ted Striker

Tuesday 03 February 2009 3:03:31 pm

Hi,

I have a site developed in eZ 3.9, that uses two different languages english and spanish. There are some articles that are translated into both languages and other articles that are published only in spanish.

Problem is that when I search for articles in one of the sites and show them in the site, they mix up, I mean both artickle and its traslation show in the page.

I use a simple code to filter articles:

{let articles=fetch(content, list, hash(parent_node_id, $node.node_id, only_translated, true(), depth, 0, limit, 5, class_filter_type, include, class_filter_array, array('article'), attribute_filter, array( array('article/published', '<', currentdate()) ), sort_by, array('attribute', false(), 'article/published') ) )}

Unfortunately this code will return both spanish and english articles mixed.

Am I doing something wrong?

Can you feel it Mr. Anderson? Closing in on you? Oh I can, I really should thank you after all. It was, after all, it was your life that taught me the purpose of all life. Purpose of life is to end.

André R.

Wednesday 04 February 2009 1:46:22 am

That depends on your site.ini settings ([RegionalSettings] SiteLanguageList and maybe ShowUntranslatedObjects).

btw: its probably more efficient to sort / filter by object published time instead of object attribute, IF you have setup workflow to modify object publish time anyway.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 16:12:33
Script start
Timing: Jan 18 2025 16:12:33
Module start 'layout'
Timing: Jan 18 2025 16:12:33
Module start 'content'
Timing: Jan 18 2025 16:12:34
Module end 'content'
Timing: Jan 18 2025 16:12:34
Script end

Main resources:

Total runtime0.8306 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.0053 587.9375152.6250
Module start 'layout' 0.00530.0031 740.562539.4453
Module start 'content' 0.00830.8209 780.0078531.5703
Module end 'content' 0.82920.0013 1,311.578112.1563
Script end 0.8306  1,323.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4017160.0002
Check MTime0.00130.1588160.0001
Mysql Total
Database connection0.00070.085310.0007
Mysqli_queries0.786094.6300540.0146
Looping result0.00050.0584520.0000
Template Total0.798796.220.3993
Template load0.00200.236820.0010
Template processing0.796795.915820.3983
Template load and register function0.00010.017010.0001
states
state_id_array0.00120.145710.0012
state_identifier_array0.00100.120320.0005
Override
Cache load0.00170.1998150.0001
Sytem overhead
Fetch class attribute can translate value0.00070.080320.0003
Fetch class attribute name0.00110.135040.0003
XML
Image XML parsing0.00100.124620.0005
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00100.1144230.0000
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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs