To answer, it's important to understand where Vorto looks up it's languages. It doesn't just the list of languages defined in the settings section, instead, it only uses languages that are actually "in use" on the website, so that means, it only uses languages that are assigned to nodes using the "hostname and cultures" dialog.
So, if you don't supply an xpath statement, Vorto will lookup in the database all languages in use as "cultures" and return those. If you want to be more specific though, for example, maybe you run multiple multi-lingual websites in one install, with both sites supporting different languages, and you don't want un-used languages from site A to be visible in site B, then this is when the XPath comes in handy.
So the XPath field allows you to provide and XPath statement that Vorto should use to find specific nodes with cultures defined (rather than all of them). The XPath support 3 key variables,
$currentPage = the current page you are currently editing
$parentPage = the parent page of the page you are currently editing
$ancestorOrSelf = the current page, or parent page (if current page isn't available, such as during create) of the page you are currently editing.
So as an example, you could have something like the following:
Which says, starting from the parent page of the page I am editing, look back through my ancestors till you find a page with the doc type alias of "Region", then find all nodes underneath that with a doc type alias of "LanguagePage".
Hopefully this gives you a good understanding of how the XPath statements work, but if you need any more information, don't hesitate to ask.
Thanks for the quick and detailed response.
What I'm trying to achieve is one single site (one tree) in umbraco that has three languages.
So how do I configure this? Seems like I can only point one culture to the root node.
Should I create some structure that contains the languages then?
Ahh, good point. As it stands, you'd probably have to define multiple domains for the root node (you don't have to use them, but that's the only way to define multiple languages for a node).
Sounds like it might be an idea for me to add support for using all setup languages, or just languages in use, that way it should be more flexible.
What properties you have on the language nodes is not important, it's just the fact you need nodes with language cultures defined upon them (via the hostnames dialog). Beyond that, the rest is up to you.
I think I may have been lookign at it slightly differently.
Guess I need to think of my architecture but I'm tryign to implement with one domain and not /en or /de folders either for example. Was going to go old school and stick culture/language selection in a cookie when a flag was selected but defaulting to English.
That's cool, and to be honest, probably how most people will use it. I just created vorto based on my needs, so probably didn't think that all through properly.
I'm gonna try and take a look tonight and add support for using all installed languages, not just in-use languages, so that way it can support both.
Ok, I've just released an updated package which allows you to set the language source. The option can be either "installed" which will just use all languages found in the "languages" section within umbraco, or "in-use" which will use languages that are found to be in use on the site via the hostnames dialog.
Hopefully this should simplify things a little for you both.
Language example
Could you give me an example what you mean with the language x-path configuration. How does a language node look like?
Hey nojaf,
Good question :)
To answer, it's important to understand where Vorto looks up it's languages. It doesn't just the list of languages defined in the settings section, instead, it only uses languages that are actually "in use" on the website, so that means, it only uses languages that are assigned to nodes using the "hostname and cultures" dialog.
So, if you don't supply an xpath statement, Vorto will lookup in the database all languages in use as "cultures" and return those. If you want to be more specific though, for example, maybe you run multiple multi-lingual websites in one install, with both sites supporting different languages, and you don't want un-used languages from site A to be visible in site B, then this is when the XPath comes in handy.
So the XPath field allows you to provide and XPath statement that Vorto should use to find specific nodes with cultures defined (rather than all of them). The XPath support 3 key variables,
$currentPage
= the current page you are currently editing$parentPage
= the parent page of the page you are currently editing$ancestorOrSelf
= the current page, or parent page (if current page isn't available, such as during create) of the page you are currently editing.So as an example, you could have something like the following:
Which says, starting from the parent page of the page I am editing, look back through my ancestors till you find a page with the doc type alias of "Region", then find all nodes underneath that with a doc type alias of "LanguagePage".
Hopefully this gives you a good understanding of how the XPath statements work, but if you need any more information, don't hesitate to ask.
Many thanks
Matt
Hello Matt,
Thanks for the quick and detailed response. What I'm trying to achieve is one single site (one tree) in umbraco that has three languages. So how do I configure this? Seems like I can only point one culture to the root node. Should I create some structure that contains the languages then?
Hi nojaf,
Ahh, good point. As it stands, you'd probably have to define multiple domains for the root node (you don't have to use them, but that's the only way to define multiple languages for a node).
Sounds like it might be an idea for me to add support for using all setup languages, or just languages in use, that way it should be more flexible.
I'll get it added in the next release.
Matt
Thanks for a great package. Looks to be exactly what I need on this particular project.
One questions....What properties should be within the language node?
Thanks
Matt
Hi dillorscroft,
What properties you have on the language nodes is not important, it's just the fact you need nodes with language cultures defined upon them (via the hostnames dialog). Beyond that, the rest is up to you.
Does that make sense?
Matt
I think I may have been lookign at it slightly differently.
Guess I need to think of my architecture but I'm tryign to implement with one domain and not /en or /de folders either for example. Was going to go old school and stick culture/language selection in a cookie when a flag was selected but defaulting to English.
A screener would be awesome.
Matt
Hey dillorscroft,
That's cool, and to be honest, probably how most people will use it. I just created vorto based on my needs, so probably didn't think that all through properly.
I'm gonna try and take a look tonight and add support for using all installed languages, not just in-use languages, so that way it can support both.
Matt
Ok, I've just released an updated package which allows you to set the language source. The option can be either "installed" which will just use all languages found in the "languages" section within umbraco, or "in-use" which will use languages that are found to be in use on the site via the hostnames dialog.
Hopefully this should simplify things a little for you both.
Many thanks
Matt
Hello Matt,
Thanks for the quick update. This is really helpful.
h5yr!
nojaf
Could you please give brief description on the behavior Sync check box as shown in the screen shot below
is working on a reply...