Personal tools

Contact Us 24/7 > 1 866.SIX FEET
Sections

Skip to content. | Skip to navigation

Home > Blog > Localizing Subsites with Lineage and LinguaPlone

Blog

Localizing Subsites with Lineage and LinguaPlone

written by thomas on Thursday March 31, 2011

We recently had a customer interested in both localizing their main site and adding subsites to it (a "subsite" is a folder of the main site that has been transformed into a virtually autonomous site with Lineage).

It is a situation that many companies are facing: they have a website for the company and wish to have an independent website for one of their top products/brands. This subsite will need a personalized look and feel, but needs to be updated and managed like it's part of the main site.

Naturally, after localizing the main site, the next step was to know if we could localize the subsites as well.

Introduction to the Tools We Used

Lineage is a Six Feet Up product which allows subfolders of a Plone site to appear as autonomous Plone sites to the everyday user, without the extra effort normally required  to maintain content in a separate site.

    • It is ideal for customers with a need for multiple seemingly independent sites under a centralized management.
    • It can be combined with ThemeSwitcher for subsites to have their own look and feel.

LinguaPlone is the multilingual/translation solution for Plone. It achieves this by being as transparent as possible and by minimizing the impact for existing applications and Plone itself.

    • LinguaPlone allows you to virtually clone your site in another language, on the same instance.
    • When combined with the language selector, you can switch localization from anywhere in one click.

ThemeSwitcher is a tool which lets you apply a Plone theme to a specific folder within your site.

    • It ships with a user interface to easily apply/remove themes recursively on a given folder.
    • When combined with Lineage, it applies a unique look and feel for each subsite.

Process

The main site can be seen at www.ressoftware.com

    Creating a subsite: First, create a folder where you want this subsite to be. By default I'd recommend at the siteroot. Then on this folder's view, use the sub-types tab to add the child site sub-type to this folder. It is now a lineage subsite; it looks just like before, but gives the user the impression of being an independent site. Then using the themeswitcher tab, you can apply a different theme to you subsite.

      • Example of the "vdx" product's subsite: www.ressoftware.com/vdx
      • Note that the domain name changes, but /vdx is not a link, we are seeing an actual folder, behind some apache rewrite rules.

     

      Localizing the main site: Localizing a site is a long process. It requires almost every single item in the site to be translated into a new language. Once localized (with the translate-into tab), an item will appear in both its normal location, in its original language and in its localized location, in another language. LinguaPlone will create a parallel tree structure for your localized content.

       

        Localizing the subsite: Here comes the tricky part. LinguaPlone has no idea the folder you are trying to localize is a subsite using Lineage and ThemeSwitcher, so when you localize it, it creates a simple folder in the parallel tree structure of your foreign language. You will then need to manually go to this folder and make it a childsite, as well as reapply the special theme through ThemeSwitcher. Actually. it wasn't too hard. It only needs done once, for all the items under the subsite's root can now be localized and they will find their way to the localized subsite. The actual trick is that the localized subsites do not appear under the same parent folder as the original subsite. Instead, they are virtually under the original subsite itself.

        Summing Up

        The combination of Lineage, LinguaPlone and ThemeSwitcher allows a simple and straightforward way to deal with what often proves a complex and daunting task when dealing with localized subsites.  It gives you the flexibility required for complex branding and localization, without having to the sacrifice the ease of maintenance that was one of the main reasons you got a content management system in the first place.

         

        Are you using any combination of Lineage, LinguaPlone, and ThemeSwitcher? Do you have an original use case of a subsite you want to share?

             
            Posted by Godefroid Chapelle on Apr 01, 2011 12:18 AM
            You can make Lineage and ThemeSwitcher aware of translations by setting up event handlers for Products.LinguaPlone.events.IObjectTranslatedEvent. This way you would be able to automate making the folder a childsite and setting up the special theme.
            Posted by keul on Apr 01, 2011 03:56 AM
            Sorry, I don't remember all of the features of lineage, but the #8787 Plone bug give didn't give you problems using subsites and LinguaPlone? http://dev.plone.org/plone/ticket/8787
            Posted by Robert on Nov 10, 2011 09:41 AM
            I see how you described the process and thank you, but as far as pointing top level domains to their respective child sites created by Lineage, you said you have extensive Apache rewrite rules-did you simply place these within the ZMI/Virtual host or htaccess file within each child site? Can you elaborate more on this and what you did? Thanks
            Add comment

            You can add a comment by filling out the form below. Plain text formatting.

            puzzle

            Next Steps


            Select a type of support:

            Contact our sales team

            First name:
            Last name:
            Email:
            Phone Number:
            Message:
            Fight spam:
            What is + ?
             
            Call Us 1 866.SIX FEET
            Sections