Running two multilingual sites on a single ezp installation

Author Message

Sebastiaan van der Vliet

Saturday 14 August 2004 2:34:04 am

Hi,

Can anyone tell me if the setup described below is potentially problematic/stupid? Can this be done in a different (read: easier) way?

I'm trying to run two multilingual (dutch, french) sites on a single installation. The setup is as follows: www.site1.com/nl, www.site1.com/fr and www.site2.com/nl, www.site2.com/fr (I don't want to use subdomains).

My problem: With this setup is that I have four siteaccesses, with overlapping names (double "nl" siteaccess and "fr" siteaccess). So I renamed my siteaccesses to site1_nl, site1_fr and site2_nl, site2_fr. But since I do not want urls like: www.site1.com/site1_nl or www.site2.com/site2_fr I had to do the following:

I modified access.php as follows (line 103):

$name = implode( '_', $elements );

to

$hostname=explode(".",$host);
$name=$hostname[1]."_".implode( '_', $elements );

Which results in the url www.site1.com/fr being translated into site1_fr, the name of the siteaccess then used. The siteaccess name is used to create links, so to avoid all links on the page still being written as www.site1.com/site1_nl I added the following lines to file ezutils/classes/ezsys/ in function addAccessPath (line 696):

$modified_path=explode("_",$path);
$path=$modified_path[1];

which results in the siteaccess in the links on the page changed into "nl" or "fr" again (e.g. www.site1.com/nl/news/demo_news_1).

The override/site.ini setup is as follows:

URIMatchType=element
AvailableSiteAccessList[]
AvailableSiteAccessList[]=site1_nl
AvailableSiteAccessList[]=site1_fr
AvailableSiteAccessList[]=site2_nl
AvailableSiteAccessList[]=site2_fr
AvailableSiteAccessList[]=admin

It works but it seems a bit dirty to me.

Thanks for your time,
Sebastiaan

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Hapee de Groot

Sunday 29 August 2004 1:20:10 pm

Any comments on this? It could help us a lot!

Marc Boon

Thursday 19 January 2006 7:59:10 am

I know this topic is a bit old, but I haven't seen a good answer, and I have the same problems setting up a muli-site multi-language system.

I tried to work around the problem by using 2-letter language codes for site1, and 3-letter codes for site2.

Problem is: you have to make sure that the user doesn't end up in the wrong site if he/she uses the 2-letter code instead of the 3-letter one or vice-versa.

I tried to fix this using also host matching, but the combination of host and uri matching (MatchOrder:host;uri) doesn't work. See my other post (still unanswered):
http://ez.no/community/forum/install_configuration/how_to_create_multiple_multilingual_sites_in_one_install

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 31 2025 03:44:14
Script start
Timing: Jan 31 2025 03:44:14
Module start 'layout'
Timing: Jan 31 2025 03:44:14
Module start 'content'
Timing: Jan 31 2025 03:44:15
Module end 'content'
Timing: Jan 31 2025 03:44:15
Script end

Main resources:

Total runtime1.0963 sec
Peak memory usage8,192.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.3906151.2422
Module start 'layout' 0.00510.0042 739.6328220.7500
Module start 'content' 0.00941.0860 960.38284,494.5703
Module end 'content' 1.09530.0009 5,454.953111.7813
Script end 1.0962  5,466.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3246160.0002
Check MTime0.00140.1275160.0001
Mysql Total
Database connection0.00070.064910.0007
Mysqli_queries1.006691.8229590.0171
Looping result0.00060.0548570.0000
Template Total1.046895.520.5234
Template load0.00200.186520.0010
Template processing1.044795.297620.5224
Template load and register function0.00130.122910.0013
states
state_id_array0.00190.175710.0019
state_identifier_array0.00200.185220.0010
Override
Cache load0.00170.1527290.0001
Sytem overhead
Fetch class attribute can translate value0.00230.209830.0008
Fetch class attribute name0.00190.175450.0004
XML
Image XML parsing0.00180.159730.0006
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00330.2981230.0001
String conversion0.00000.000740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs