eZ Publish 4.0 Language change link

Author Message

Angelo Maiorano

Wednesday 18 June 2008 11:56:13 pm

Hello,

I setup a website in 4 languages, for different language "same" page have got different url.

I try to use syntax i see in std layout for langiage selection but link are not goog.

syntax is this one:

{if $locales|count|gt( 1 )}
{foreach $pagedesign.data_map.language_settings.content.rows.sequential as $row}
{def $site_url = $row.columns[0]
$language = $row.columns[2]}
{def $site_url=ezini( 'SiteSettings', 'SiteURL', 'site.ini' )}
{if $row.columns[0]}
{set $site_url = $site_url|append( "/" )}
{set $language = $language|append( "/" )}
{if is_set($DesignKeys:used.url_alias)}
<a href="{concat( "http://", $site_url, $language,
$DesignKeys:used.url_alias
)}">[ {$language} ]</a>
{else}
<a href="{concat( "http://", $site_url,
$DesignKeys:used.url_alias
)}">[ {$language} ]</a>
{/if}

{/if}
{undef $site_url $language}
{/foreach}
{/if}

I think the problem is to have the url in the right language.

Many thanks

Angelo

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 21:17:05
Script start
Timing: Jan 18 2025 21:17:05
Module start 'layout'
Timing: Jan 18 2025 21:17:05
Module start 'content'
Timing: Jan 18 2025 21:17:06
Module end 'content'
Timing: Jan 18 2025 21:17:06
Script end

Main resources:

Total runtime0.8706 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.0313152.6406
Module start 'layout' 0.00590.0028 740.671939.4609
Module start 'content' 0.00870.8603 780.1328403.8047
Module end 'content' 0.86900.0016 1,183.93758.1563
Script end 0.8705  1,192.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4107160.0002
Check MTime0.00140.1618160.0001
Mysql Total
Database connection0.00070.075810.0007
Mysqli_queries0.823394.5731460.0179
Looping result0.00050.0549440.0000
Template Total0.838296.320.4191
Template load0.00200.233320.0010
Template processing0.836296.049620.4181
Template load and register function0.00020.027910.0002
states
state_id_array0.00100.112710.0010
state_identifier_array0.00070.082920.0004
Override
Cache load0.00170.1933320.0001
Sytem overhead
Fetch class attribute can translate value0.00090.098810.0009
Fetch class attribute name0.00110.127310.0011
XML
Image XML parsing0.00010.013710.0001
class_abstraction
Instantiating content class attribute0.00000.001010.0000
General
dbfile0.00190.2138100.0002
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
1content/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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 5

Time used to render debug report: 0.0001 secs