Use it on a multi language website

Before I buy the white label version I have a question.
Many websites my customers used are multi language.

The folder structure looks like this:
index.php (depends on browser language, default it will go to the /en directory)
/scripts
/ccs
/images
/en (website in English)
/de (website in German)
/fr (website in French)
/nl (website in Dutch)

After installing sitecake the directory /sitecake and the file sitecake.php is added

I have read that you must put sitecake in the root, but can the user change his/her website data.
For example : user enter “http://www.mysite.com/sitecake.php” and after that he/she can go to the English/German/French or Ducth version.

Thanks

There are two ways to handle this:

  1. Don’t do anything. Default language setting is set to auto, which means Sitecake recognizes IP address of a visitor and offers corresponding language from the list

interface language (en, sl, sr, es, de, fr, dk, it, ru, cs, sk, pt, pt-br, auto)
Locale.code = auto

  1. Create separate websites, together with images and css in each of language folders. Keep home page in the root.
    Put separate Sitecake instances in each language folder /en, /de, …

I forgot to write that in second case you need to set language in the configuration for each Sitecake instance. For example:

for /de folder set editor.cnf language configuration to

Locale.code = de

That means that the customer have to login for each language? Or is the session keep alive if the password is the same in all directories?

Session is kept alive, so there is no need to log in several times.

I have done that, but it don’t work.

But all the files are in separate directories, like this example:
|- ROOT
| |- index.php (looks at browser language, from there it will go automatic to directory with language)
|
|- EN
| |- index.php
| |- admin.php
| |- CCS
| |- SCRIPT
| |- SITECAKE
|
|- NL
| |- index.php
| |- admin.php
| |- CCS
| |- SCRIPT
| |- SITECAKE

In both files index.php (EN and NL dir) there is a link (href=’…/nl/ or href=’…/en/’) to go to another language, if a click on that flag you go to that language. But if enter http://www.website.com/en/admin.php I can edit the pages. Only when I press the Dutch flag I get this url : http://www.website.com/en/admin.php?scpage=en/nl/index.php
And the directory EN/NL don’t exists
Is it possible to make it work with directories.
Now I to go to the English site edit all the files logout Sitecake, go to another language login again on Sitecake.

Thanks in advance

Hi, Sitecake is aware only about directory it is stored in, so best way I can think of to solve your problem is to render those links depending is the page called through sitecake or not.
e.g. for EN website

<?php if(strpos($_SERVER['REQUEST_URI'],"admin.php") !== false) { ?> <a href="http://www.website.com/nl/admin.php"> <?php } else { ?> <a href="../nl/"> <?php } ?>

There is also possibility to manage whole website (all languages) with one instance of sitecake uploaded in root, but in that case Sitecake language is same for all site languages, and also, if website is big sitecake can get slow.

What can slow down Sitecake admin. Number of images stored? Or number of different static html files that are edited? How would you suggest to store sitecake so it can work with separate parts of site and not copy/update the whole directory structure?

Is it getting slow on first initialize? Or on every [publish] as image data / html data grows?

It would be useful to be able to separate site to subdirectories that could be marked (in config?) to be handled separatedly. For example if I wanted to have separate portfolio pages with a lot of images and subpages. I’m only guessing here if that would be possible and if that isn’t against the philosophy of sitecake. But imagine I’m going to make a site with 10 subpages with different portfolio structures and it would be suitbale to have different image directory for each.

Well, currently, everything is copied on publish (all the pages and resources (uploaded images and files)). At the moment you can tell sitecake if there are files you DON’T want to be handled by sitecake by uploading .scignore file in site root.

By default all .html, .htm, .php and .php5 files are handled by sitecake. Also all the resources that are uploaded (or images that are manipulated) through sitecake. On each publish all files that correspond to this condition are copied by sitecake from draft directory to site root. This is done because sitecake don’t keep track which files contains which containers so because of the named containers it have to copy all the files to be sure all the pages are always up to date.

After getting page manager out, we are continuing with sitecake v3 which will include server side refactoring, and one of the things we are going to address is performance improvement, so I’m sure this is one of the things we are going to try to impreve :).

Thanx for explanation. I will try to play with .scignore it might be helpful.