Forums / General / Evaluating ezPublish; have some questions

Evaluating ezPublish; have some questions

Author Message

Luis Cruz

Tuesday 27 January 2004 12:54:08 pm

Greetings; I am evaluating ezPublish as a potential CMS solution for our company. Having run through a few of the tutorials and the documentation, I still have some questions regaarding the product. I am hoping the community can help me answer them.

1. Can you embed PHP into templates or content? While the content in our current database can be migrated over to the ezPublish system, there is some functionality that requires PHP code. For example, if a user submits a form from our site, we make an XML-RPC call via PHP to record this information with another application.

Also, we want to have a "My XXX" feature for the site; this would entail having users register with the site and having that registration information placed into an existing user database. We would want to authenticate against this database as well as pull some data from it as they interact with the personalization features of the site.

2. I have read that you can have multiple translations for content, but can you have multiple translations for templates? For example, the HTML code for our site's navigation bar would reside in pagelayout.tpl. Some of the strings in the navigation would have to be rendered in a different language. Is this possible? If so, where can I find some documentation about this process?

That's all I have at the moment.

Cheers.

---
Luis A. Cruz
Web Project Manager
lcruz[at]astaro[dot]com

Sébastien Prud'homme

Tuesday 27 January 2004 1:37:59 pm

Question 2) See http://www.ez.no/community/forum/developer/multilingual_site_images

Luis Cruz

Tuesday 27 January 2004 2:08:25 pm

> Question 2) See http://www.ez.no/community/forum/developer/multilingual_site_images

OK; my issue is actual text in the template needs to be translated in the template itself. So, let me see if I understand how this system would work.

Each translation would have its own siteaccess that would contain its own templates. Each template would have its own translation of the various text. The content would all be served from one repository. Does this sound accurate? Is there any decent documentation for working with multiple languages under ezPublish?

I found this one:
http://ez.no/ez_publish/documentation/configuration/configuration/language_and_charset/how_to_setup_a_multilingual_site

But it still is lacking in detail. Any others?

Lazaro Ferreira

Tuesday 27 January 2004 3:25:30 pm

Hi,

We have developed a fully two-language site with EZP 3, my understanding is that you can have what you want with EZP 3

Frst : The siteaccess lets you use a default translation for each part of your site, so you don't have to bother with coding template logic for this

In our case we had three types of elements to translate to:

1) Content
2) Hard Coded Text in the templates
3) Images or media that shows text information, like a site menu made from images instead of text

1) For the first type we used the Translation in the EZP Admin
2) For the second type we used the i18n() template operator
3) For the third type we overrided de images subdirectory of our main language design directory
something like this :
design/spanish {*main language*}
design/spanish/images

So if you want to use different images for you english version then you creates:
design/english {*second language*}
design/english/images

Then go to your settings/siteaccess/spanish/site.ini.append and set:
[DesignSettings]
SiteDesign=spanish
AdditionalSiteDesignList[]=

and, go to your settings/siteaccess/english/site.ini.append and set:
[DesignSettings]
SiteDesign=english
AdditionalSiteDesignList[]=spanish
-------------------------------------
The last line of code above do the trick, simply using the override settings of EZP, it means that while in the english siteaccess (your second language here) EZP will look for any template not included in design/english at design/spanish

As the templates includes content fetched from DB, and text hardcoded that will be translated automatically by i18n operator they are "truly" multilanguage, so you don't need to duplicate it, at least that you want to change the layout of them according to the language

Last, dont forget to set the following settings of each siteaccess accordingly
From our site that is English and Portuguese, the portuguese siteaccess (the second one) read as :
...
[ContentSettings]
ViewCaching=enabled
TranslationList=por-PT;eng-GB

[RegionalSettings]
Locale=por-PT
ContentObjectLocale=por-PT
TextTranslation=enabled
TranslationCache=enabled
...

Hope this help

Lazaro
http://www.mzbusiness.com

Luis Cruz

Wednesday 28 January 2004 6:59:41 am

Lazaro, thanks; that helped quite a bit. Gave me a few more items to search on. Still don't fully understand how #2 would work, but I found this thread to ask further questions about the i18n function:

http://www.ez.no/community/forum/developer/what_is_i18n_

If you can provide further insight in this thread or the one above, that would be appreciated.

Thanks again.

Lazaro Ferreira

Wednesday 28 January 2004 4:31:13 pm

Hi Luis,

Again, you can achive #2 using EZP 3, To do what you want at number 2, we use the template operator i18n(), as stated in the thread you mentioned above this operator uses the current language of ezpublish, this is is set at your siteaccess site.ini.append file, here I will try to give you an step by step guide to got it

Premises :
If you installed EZP 3 using the normal installation (using the wizard) and tell the installer that you will use two languages, for example English and Portuguese, and the name of your user side site is 'en' (short for English), then at the end of installation you got the file

settings/siteaccess/en/site.ini.append that should included something like this :

[ContentSettings]
TranslationList=eng-GB;por-PT

To create a truly bi-lingual (or multilingual) site you will have to create a siteaccess for each additional language that you need

Here the steps to setup a second language in your web site, this is based on our site, so we will use portuguese language to demo

1) Create a new directory under settings/siteaccess, we called 'pt'
2) Copy every file under settings/siteaccess/en/ to settings/siteaccess/pt/
3) Check ownershihp, dir and file permissions on and under 'pt', they should match it on and under 'en'
4) Create a new directory pt under design (you should already have and 'en' directory under design created by ezp installer)
5) Create a directory for overriding images used in the portuguese site, you should already have a design/en/images directory so create a design/pt/images
6) Check in 4 and 5 (step 3)
7) Edit your site.ini.append under pt, changing the following lines:

[SiteSettings]
SiteURL=my.domain/index.php/en

[DesignSettings]
SiteDesign=en
AdditionalSiteDesignList[]=

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB

to:

[SiteSettings]
SiteURL=my.domain/index.php/pt

[DesignSettings]
SiteDesign=pt
AdditionalSiteDesignList[]=uk

[RegionalSettings]
Locale=por-PT
ContentObjectLocale=por-PT

8) Edit your general override settings file at settings/override/site.ini.append
[SiteSettings]

DefaultAccess=en

SiteList[]
siteList[]=en
SiteList[]=pt

[SiteAccessSettings]

AvailableSiteAccessList[]
AvailableSiteAccessList[]=en
AvailableSiteAccessList[]=pt
AvailableSiteAccessList[]=admin

SiteAccessList[]
siteAccessList[]=en
SiteAccessList[]=pt
SiteAccessList[]=admin

9) Clean all EZP caches

Now you have setup the basis for a truly bi-lingual (or multilingual) site

Check it, opening your main and secondary SiteUrl in you browser, you can translated some content, or use the i18n() operator in your template for some hard coded text

The principle is that for opening the SiteURL: my.domain/index.php/pt, EZP will use the templates and images in design/pt if available, else they will use the desing/en templates and images, as design/pt is already empty (no .tpl file and no image files) it actually uses your design/en templates and image, until you add images and templates to the design/pt dir

-----------------------------------------------------------------------------
Regarding the i18n() operator, it will use the .ts file for the language of your siteaccess (defined in your site.ini.append see 'RegionalSettings' at step #7 ), I think is that simple
if it doesn't find the translation string, it will default to the hard code text, normally it is the text in Eng-GB, because EZP uses Eng-GB as its default language
-----------------------------------------------------------------------------
To add translations you should use the translation system, the translation system, have a command line tool that goes through your web site .tpl files adding every i18n() hard code text to its database ( the .ts file ), (all of them are stored as Eng-GB text), after that you run its editor (a GUI application) that helps you adding your translations for every term added before, finally the editor will save your .ts file, this is the one you should copy to your web site at share/translations/your_language/translation.ts

More information on this at: http://ez.no/developer/ez_publish_3/translations

Luis, I'm sorry if I have missed something about the .ts translation, I'm not in charge for this in my team, so I'm learning also :-)

OOPS, it seems like I'm writing a book on this, hope this help to get the job done, case not I will resign :-)

Lazaro
http://www.mzbusiness.com

Luis Cruz

Thursday 29 January 2004 8:20:38 am

Lazaro, you should be writing the book on this. :) Decided to do a fresh install and follow your steps to the letter. Success! At least for content objects; have yet to try out the translation tools you mentioned for i18n() text in my templates though.

I seem to be having a huge problem now though with caching and creating custom templates. For example, I create a new folder under the root folder called "About". In this folder, I create an article called "Us". Now, if I browse to {path to ezp}/index.php/en/about/us, I get the default object view. Using {path}/de/about/us shows the German version. All is well so far.

Now, I try to create a custom template for this page. I create a new /node/view/full.tpl override template and associate it with Node X (where X is the node id for the "Us" article). I flush the cache via the admin console, and try to reload the page. The behavior ranges between displaying nothing or continuing to display the default object view. I have to manually delete the var/en directory and then refresh the page to see my new template in action.

Also, it appears I have to create the same override template for the German side which does not seem to be the behavior you have described above. I expected the /de site to default to the /en template when displaying the "Us" article. Again, after creating the template, I have to delete the cache directory (I used var/de for the cache; should I not do that?) to get the page to display.

I am going to try to do a fresh install (again), create some content without making your changes, see if I still have the caching problem, and then go from there.

Thanks though for all your help; it may not be perfectly working, but I think you are helping me get there.

Lazaro Ferreira

Friday 30 January 2004 11:07:19 am

Hi,

Nice to hear you are getting there

Check your PHP version, PHP 4.2.x is reported as unstable by ezcrew, I think there are problems with php session handling in this version

You may also check if you are using template cache block in your troubled templates, they can have side effects you need to consider when designing your template, there are some interesting threads and doc, on using cache block properly search the forum

Remember that you don't need to create a .tpl file for each language, at least that you want to change the template layout, is all that you want is information translation you don't need it at all

Last, check your cache settings at every siteaccess site.ini.append

Cheers
Lazaro Ferreira

Lazaro
http://www.mzbusiness.com