Hey guys... Working on a commerce site in Umbraco V4.0.2.1. I've created several multilingual sites with a structure like this:
Danish Frontpage
-page below
-page below
English Frontpage
-page below
-page below
etc.
-This structure works very well, but the problem I'm facing atm is, that our client doesn't want to add the products for every language, but instead wants the products to work as 1:1, with languages in tabs (even though we tried to talk him out of this :p)
So I'm thinking about building a structure like this:
Danish Frontpage
-page below
English Frontpage
-page below
Product Catalog
-ProductType
--Product
--Product
-ProductType
--Product
etc.
Is it possible to use this structure? Or should I create the complete site on a 1:1 basis? Any feedback would be great... :)
Another approach could be to use the "Relate copied items to orignal" and copy the products in the different language websites. Once they are copied you could use an Action Handler to update the content when an editor publishes a page.
Len's solution is a great solution. we've been working on multilingual sites where we put all 'non language' dependent stuff in a node under the content node (at the level of the language nodes from your example) and pull all data from this node using the available datatypes such as the ultimate picker (as an example)
It might become a little more tricky if you need to have products in different languages as well. You could still go for the 1:1 approach on the product stuff (create tabs to specify product data), or create x 'repository' nodes (one for each language) and pull data from the correct repo node depending on the language you're working on!
Why would I need to use some sort of picker? As far as I know every product should be listed on every language. Wouldn't it be possible just to list the products via xslt? The only problem would be how to load the right language?
Alright, just tried with a simple site with the contstruction mentioned above. :)
I can retrieve the products from the different language nodes (using a xslt which list all products below "NodeTypeAlias = ProductArea", but I've a bit of a problem from here. When I jump to a product, the navigationmenu etc. is lost because of the fact that the start node is now the "Product Catalog". And furthermore I can't seem to get the different languages working on this page (prob. because the Product Catalog haven't got hostnames / languages?).
Maybe the problems above could be solved by using the "picker"-approach?
I would be very grateful if any of you two guys (or anyone else) would explain how your solutions works in detail.
Maybe i am too late, but you should have 2 macros.
One for the navigation, which should have a starting node.
I always use this kin dof variable: <xsl:variable name="source" select="$currentPage/ancestor-or-self::node[@nodeTypeAlias = 'HomePage_v3']/@id"/>
This variable should give you the id from the homepage (not the products), in English or the Danish one. From there you can walk through the nodes in the english website.
The second macro should find out the language of the website, but I think you have to write your own XSLT method for that with an extension (see below example)'. And reference the Product page you need usin ghte multipage picker.
Example tree with example for property and tabs
English webpage
page 1 ( mutlipage picker datatype selecting the Id of a product page )
Danish webpage
page 1 ( mutlipage picker datatype selecting the Id of a product page )
Product page
product 1 ( 2 tabs for both languages, here you have a 1-1 relationship, each tab contains a richtexteditor for the SME to maintain)
/// <summary>
/// Returns the ID of the current language.
/// </summary>
/// <returns>The ID of the current language, or 0 if it could not be determined.</returns>
One last question regarding the structure: Wouldn't the structure above cause the client to create a "reference-node" below every "language-node" per product? This would cause a lot of work to our client - the page is actually in 7 languages with some 200-250 products.
I would very much warn against your approach (if I understand it correctly) for one major reason: Google will have problems figuring out what language a given page is in.
In Google's eyes, you always need one unique URL for each unique piece of content. Ie. you can't have the URL mypage.com/products/product001.aspx display two different language versions of the content, depending on which language you come from or have selected in some way.
Yes, you would need to duplicate each product with a reference in both websites, but I assume that, in time, there will be differences between the 2 languages. In my experience with mutlilingual websites, it is not always about the language, it is also a different culture with different requirements.
Of course if you are sure, and this is not a programming problem, but more a site management, or IA problem, that you only need a 1:1 setup, that might be a maintenance problem ...
But to get around that, you could go for the related content and the action handler.
Or maybe you could create another action handler that creates the pages for you, whenever a new product has been added?
I would suggest to create the English version first manually, make a package out of it and upload it in the Danish node. That reduces the (startup) work by halve, and it you create your macro's right, you should not even need to change these pages, as all dictionary items should pick up the proper language.
For the URLs, I suppose they will run on different domains? Or different subfolders: mydomain.com/en/folder1/page1.aspx ?
Which URL structure did you have in mind for the languages?
-Yes, I'll keep that in mind... Thanks for the heads up. :)
Len:
-I've just talked to the client and he wants to control every single product on all languages from one node, so I think I've to try the 1:1 approach... If it wasn't for the client I would use your approach mentioned above, so I'll mark that as my solution to other visitors.
Difficult multilingual site, need advice!
Hey guys... Working on a commerce site in Umbraco V4.0.2.1. I've created several multilingual sites with a structure like this:
Danish Frontpage
-page below
-page below
English Frontpage
-page below
-page below
etc.
-This structure works very well, but the problem I'm facing atm is, that our client doesn't want to add the products for every language, but instead wants the products to work as 1:1, with languages in tabs (even though we tried to talk him out of this :p)
So I'm thinking about building a structure like this:
Danish Frontpage
-page below
English Frontpage
-page below
Product Catalog
-ProductType
--Product
--Product
-ProductType
--Product
etc.
Is it possible to use this structure? Or should I create the complete site on a 1:1 basis? Any feedback would be great... :)
-And thanks in advance!
HI,
I haven't tried this myselve, but the structure you propose should work as I have similar structures for categories in our websites.
You can use the multipage picker datatype, to put content in the English part and in the Danish part, referencing the products in the product section.
After that, you load the content in the proper language in each webpage with an XSLT macro.
( http://www.cpalm.dk/1116.aspx )
Another approach could be to use the "Relate copied items to orignal" and copy the products in the different language websites. Once they are copied you could use an Action Handler to update the content when an editor publishes a page.
Hope this helps,
Len.
Len's solution is a great solution. we've been working on multilingual sites where we put all 'non language' dependent stuff in a node under the content node (at the level of the language nodes from your example) and pull all data from this node using the available datatypes such as the ultimate picker (as an example)
It might become a little more tricky if you need to have products in different languages as well. You could still go for the 1:1 approach on the product stuff (create tabs to specify product data), or create x 'repository' nodes (one for each language) and pull data from the correct repo node depending on the language you're working on!
Cheers,
/Dirk
Thanks for the quick replies guys, really great!
Why would I need to use some sort of picker? As far as I know every product should be listed on every language. Wouldn't it be possible just to list the products via xslt? The only problem would be how to load the right language?
The products are 1:1, requested by our client.
Alright, just tried with a simple site with the contstruction mentioned above. :)
I can retrieve the products from the different language nodes (using a xslt which list all products below "NodeTypeAlias = ProductArea", but I've a bit of a problem from here. When I jump to a product, the navigationmenu etc. is lost because of the fact that the start node is now the "Product Catalog". And furthermore I can't seem to get the different languages working on this page (prob. because the Product Catalog haven't got hostnames / languages?).
Maybe the problems above could be solved by using the "picker"-approach?
I would be very grateful if any of you two guys (or anyone else) would explain how your solutions works in detail.
Thanks again.
Still struggling with the problems above... Thinking about changing to a complete site based on the 1:1 approach.
Hi,
Maybe i am too late, but you should have 2 macros.
One for the navigation, which should have a starting node.
I always use this kin dof variable: <xsl:variable name="source" select="$currentPage/ancestor-or-self::node[@nodeTypeAlias = 'HomePage_v3']/@id"/>
This variable should give you the id from the homepage (not the products), in English or the Danish one. From there you can walk through the nodes in the english website.
The second macro should find out the language of the website, but I think you have to write your own XSLT method for that with an extension (see below example)'. And reference the Product page you need usin ghte multipage picker.
Example tree with example for property and tabs
English webpage
page 1 ( mutlipage picker datatype selecting the Id of a product page )
Danish webpage
page 1 ( mutlipage picker datatype selecting the Id of a product page )
Product page
product 1 ( 2 tabs for both languages, here you have a 1-1 relationship, each tab contains a richtexteditor for the SME to maintain)
/// <summary>
/// Returns the ID of the current language.
/// </summary>
/// <returns>The ID of the current language, or 0 if it could not be determined.</returns>
public static string GetLanguageAlias(int pageId)
{
int languageId = 0;
string la = string.Empty;
try
{
Domain[] domains = umbraco.library.GetCurrentDomains(pageId);
if (domains != null && domains.Length >= 0)
{
languageId = domains[0].Language.id;
Language l = new Language(languageId);
la = l.CultureAlias;
}
return la;
}
catch (Exception errDictionary)
{
HttpContext.Current.Trace.Warn("library", "Error returning language alias for'" + pageId + "'", errDictionary);
return string.Empty;
}
}
Hi Len! Thanks a lot for the reply... :)
One last question regarding the structure: Wouldn't the structure above cause the client to create a "reference-node" below every "language-node" per product? This would cause a lot of work to our client - the page is actually in 7 languages with some 200-250 products.
But really, thanks for taking the time to reply!
I would very much warn against your approach (if I understand it correctly) for one major reason: Google will have problems figuring out what language a given page is in.
In Google's eyes, you always need one unique URL for each unique piece of content. Ie. you can't have the URL mypage.com/products/product001.aspx display two different language versions of the content, depending on which language you come from or have selected in some way.
/SoerenS
Hi,
Yes, you would need to duplicate each product with a reference in both websites, but I assume that, in time, there will be differences between the 2 languages. In my experience with mutlilingual websites, it is not always about the language, it is also a different culture with different requirements.
Of course if you are sure, and this is not a programming problem, but more a site management, or IA problem, that you only need a 1:1 setup, that might be a maintenance problem ...
But to get around that, you could go for the related content and the action handler.
Or maybe you could create another action handler that creates the pages for you, whenever a new product has been added?
I would suggest to create the English version first manually, make a package out of it and upload it in the Danish node. That reduces the (startup) work by halve, and it you create your macro's right, you should not even need to change these pages, as all dictionary items should pick up the proper language.
For the URLs, I suppose they will run on different domains? Or different subfolders: mydomain.com/en/folder1/page1.aspx ?
Which URL structure did you have in mind for the languages?
Søren:
-Yes, I'll keep that in mind... Thanks for the heads up. :)
Len:
-I've just talked to the client and he wants to control every single product on all languages from one node, so I think I've to try the 1:1 approach... If it wasn't for the client I would use your approach mentioned above, so I'll mark that as my solution to other visitors.
All:
-Thansk for taking the time to reply!
is working on a reply...