Forums / Developer / Running two multilingual sites on a single ezp installation

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

eZ debug

Timing: Jan 18 2025 16:08:53
Script start
Timing: Jan 18 2025 16:08:53
Module start 'content'
Timing: Jan 18 2025 16:08:54
Module end 'content'
Timing: Jan 18 2025 16:08:54
Script end

Main resources:

Total runtime0.9913 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.9688180.7969
Module start 'content' 0.00660.8559 768.7656592.2188
Module end 'content' 0.86250.1288 1,360.9844336.7109
Script end 0.9913  1,697.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3992210.0002
Check MTime0.00150.1483210.0001
Mysql Total
Database connection0.00070.071610.0007
Mysqli_queries0.918292.62511960.0047
Looping result0.00200.20111940.0000
Template Total0.959396.820.4797
Template load0.00230.230520.0011
Template processing0.957096.540120.4785
Template load and register function0.00010.007910.0001
states
state_id_array0.00110.115410.0011
state_identifier_array0.00110.111920.0006
Override
Cache load0.00180.1770290.0001
Sytem overhead
Fetch class attribute can translate value0.00100.097440.0002
Fetch class attribute name0.00120.120350.0002
XML
Image XML parsing0.00130.132340.0003
class_abstraction
Instantiating content class attribute0.00000.000850.0000
General
dbfile0.00360.3598340.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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