|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
Hi there, I know there are a lot of these topic on going, but I still do nog managed to build a multi-lingual site. At this moment we have these site http://www.ferox-it.nl. I've succefully upgraded the site to V3.0.3 but now I have to implement multi-lingual. My idea is to create a structure like these: -- Root ----- Site ------- NL --------- (NL Pages) ------- EN --------- (EN Pages) At this moment I defined Site, NL and EN as Document Type HomePage. Does somebody wants to help me with this issue. The navigation of the site has to look exactly in the same way as the site I mentioned above. So each language has to got his own homepage. I hope you guys can help me.
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
Hi, The first step would be to add the 2 languages. So go to the settings section, there you have a languages 'folder'. There you will need to add the languages, so in your case probably Dutch(Netherlands) and English (United Kingdom). So just right click and select create ... Now the next step is to define wich language your 'homepage' nodes ( and childnodes ) need to use. So go to the content section, right click your NL node And select Manage hostnames. So now you need to enter a domain and select a language. There are multiple options here. If you have a different domain for each of your languages ( like .nl for the nl version and .com for the en version ). You can enter that as a domain. Like http://www.domain.nl, then choose the languages ( you can choose from the languages you created earlier). So now you do the same for the EN node, .com and English. So now you can test if this config works. If you request http://www.domain.nl you should see the nl node, http://www.domain.com, the en node. ( you can also use dummy domains ...) So the last step would be to create dictionary items for al of the text in your templates So go to he settings section again and there you also have a dictionary 'folder', so right click, choose create, define a name and you will see that the dictionary item has 2 tabs ( 1 for each language you created). So now you can add that dictionary item on your template. Like this: Code: <?UMBRACO_GETITEM field="#namedictionaryitem"/>
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
Thank for your help so far. At this moment I've configured the two hostnames.
http://dutch/ goes to the Dutch pages http://english/ goes to the English pages
But our contact page for example goes to http://dutch/nl/contact.aspx but that doesn't work. I got an "Page cannot be found" exception. How do I have to solve this?
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
And http://dutch/contact.aspx does that work ?
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
No that doesn't work either.
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
It's hard to know what the problem is without looking at the umbraco backend..., can you provive a screenshot of the content section (collapsed) and the manage hostname settings ?
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
I've already solved it. Thanks to an article on your blog. I had to set UseDomainPrefix to false. That's solved my problem.
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
Great
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
I've got just another question, the site construction mentioned earlier in my post does now have two homepages. An english homepage and a dutch homepage. In my navigation menu for the english site have the following items:
nl - en - About - Contact
Depending on wich domain a user entered do I want to display only EN or NL. How do I have to manage that in XSLT.
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
Can you show your xslt you have that outputs that
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
Here is the XSLT code Code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<ul id="Navi">
<xsl:for-each select="$currentPage/ancestor::node [@level=1]/node [string(./data)]"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li> </xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=2]/node [string(./data [@alias='umbracoNaviHide']) != '1']"> <li> <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id"> <xsl:attribute name="class">Selected</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li> </xsl:for-each> </ul>
</xsl:template>
</xsl:stylesheet>
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
and when you browse one of the subpages, do you still see both the Nl and EN ?
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Newbie
Joined: 12/5/2007 Posts: 7
|
Problem is solved.
|
|
 Rank: Devotee
Joined: 3/30/2008 Posts: 94 Location: Sweden
|
I am struggling with the same problem, can you please tell me what you did to get the navigation correct for this setup?
When I am in English section, I only want the navigation to render sub-nodes of the English node.
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
How does your node structure look ? -EN -OTHERLANG
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
 Rank: Devotee
Joined: 3/30/2008 Posts: 94 Location: Sweden
|
Error trying to edit post, so I post again, sorry. Code: <English> -<Submenu1> -<Submenu2> -<Submenu3>
<Swedish> -<Submenu1> -<Submenu2> -<Submenu3>
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 671 Location: Belgium
|
This should do the trick. Will display the submenu items of the current language Code:
<xsl:for-each select="$currentPage/ancestor::node [@level=1]/node"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li> </xsl:for-each>
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
 Rank: Devotee
Joined: 3/30/2008 Posts: 94 Location: Sweden
|
Thanks for the reply tim, but I can't get it working. My nodestructure is as follows Code: <Content> <English> -<Submenu1> -<Submenu2> <Swedish> -<Submenu1> -<Submenu2>
I have added the languages in Settings and rightclicked the english and swedish node -> Manage hostname and added domain en for <English> and domain se for <Swedish>. However when I browse to http://localhost/en/ or http://localhost/se/ I get the following error: No node found (http://localhost:3185/default.aspx?umbPage=/en, '/root/node [@urlName = "en"]') But when I browse to http://localhost/english/ or http://localhost/swedish/ pagenames of the main nodes, the page is rendered. But the menu is not rendering correctly. I have the following XSLT Code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/>
<xsl:template match="/"> <ul class="ul"> <xsl:for-each select="$currentPage/ancestor::node [@level=1]/node"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"> <xsl:value-of select="@nodeName" /> </xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li> </xsl:for-each> </ul> </xsl:template> </xsl:stylesheet>
I am sorry for the long post and beginner-questions.
|
|
 Rank: Devotee
Joined: 8/5/2007 Posts: 92 Location: Bergen, Norway
|
What is not rendered correctly? Is it like your problem described in your ( other post?) www.eyecatch.no
|
|
 Rank: Devotee
Joined: 3/30/2008 Posts: 94 Location: Sweden
|
Hi azzlack and thanks for the replies..
The problem is that nothing is rendered for the menu and I am unable to browse to /en/
|
|
|
Guest |