Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anthony Candaele 1197 posts 2049 karma points
    Mar 29, 2011 @ 20:09
    Anthony Candaele
    0

    just tested multi-language tools

    Hi Yannick,

    I just tested the Multi-Language tools package. Everything works ... but not quite as I expected. I hoped that with your package, it would be possible to put relations between pages of different languages. So for instance, if you would have a page 'services' on the English website, and a page 'diensten' on the Dutch website, the administrator could set a relation between both pages, so that when a visitor on the 'services' page clicks on the language switch link, he would go automatically to the 'diensten' page.

    Or is this possible with your tool?

    Thanks for your work,

    Anthony

  • Daniel Bardi 927 posts 2562 karma points
    Mar 29, 2011 @ 20:24
    Daniel Bardi
    0

    There is a package to manage node relations here: http://our.umbraco.org/projects/developer-tools/relation-types

  • Yannick Smits 321 posts 718 karma points
    Mar 29, 2011 @ 21:18
    Yannick Smits
    1

    Daniel, that package is not able to manage node relation. You can only manage relation types not the relations themselves.

    Anthony, if you start with your English website and relate nodes upon copy to the Dutch site they should already be related. When your site progresses and you add nodes you can have them automatically related using the .cs file I added today to this project. If you place it in the app_code it will automatically create corresponding pages for all languagesn upon creation of a new document (on publish actually).
    Unfortunately there is no easy way currently to manage relationships using a GUI as I found out today in this thread.

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 30, 2011 @ 08:58
    Anthony Candaele
    0

    Hi Yannick,

    I guess that I'll have to remove my Dutch document node and childe node and do a new copy this time with the 'relate to original' checkbox checked? I'll give that a try tonight, as for the moment I'm not on my development machine.

    So if I got it correctly, once the .cs file is put in the app_code folder, and the copy of the Englisch document node is done, the user should be able to switch to another language variant of a page using the LanguageSwitcher?

    thanks for your advice,

    Anthony

  • Yannick Smits 321 posts 718 karma points
    Mar 30, 2011 @ 10:36
    Yannick Smits
    0

    You don't need the .cs file for that. The only thing the .cs file does is that when you create a new document in your English node it will automatically copy it to child nodes and relate it.

    If you want to add relations to existing pages you can do that directly into the umbracoRelation table. You only need the parentid and child id which is pretty straight forward.

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 30, 2011 @ 18:58
    Anthony Candaele
    0

    Hi Yannick,

    I recopied the English document node and checked the 'relate to original source' checkbox. If I look in the umbracoRelations table I see that the relation records between the pages are created. So do I only have to add the LanguageSwitch macro now to every page, and wil it automatically link to the same page in the other language?

    Thanks for your advice,

    Anthony

  • Yannick Smits 321 posts 718 karma points
    Mar 30, 2011 @ 19:02
    Yannick Smits
    0

    That's correct!

    Currently it will only return you a list of hyperlinks with the corresponding language but I'm working on a version with country flags and a version styled as a dropdownlist. Will package that up for tomorrow.

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 30, 2011 @ 19:18
    Anthony Candaele
    0

    Hmm, I don't know if I'm doing something wrong, but it doesn't work. The link on the Dutch 'diensten' page (http://www.webmove.nl.local/diensten.aspx) links to the English 'home' page (http://www.webmove.en.local/), and on the English 'services' page, the link to the Dutch 'diensten' page points to the English domain (http://www.webmove.en.local/services.aspx)

    Maybe I should page the LanguageSwitch macro on all the English pages béfore I make a copy of the English document node.

    Or maybe I should change the relation type in de developer section (see screenshot):

    Anthony

  • Yannick Smits 321 posts 718 karma points
    Mar 30, 2011 @ 19:49
    Yannick Smits
    0

    It doesn't matter if you add the macro before or after the copy. It's just a view on the data.

    Strange behavior! Could you check your umbracoRelations table to see if the relations are correct in the database?

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 30, 2011 @ 20:02
    Anthony Candaele
    0

    I have checked the umbracoRelations table, the id's between parentId and childId are correct. I have installed also Hendy's Relation Types package (see screenshot). Could this package be interfering?

  • Yannick Smits 321 posts 718 karma points
    Mar 30, 2011 @ 21:35
    Yannick Smits
    0

    Hendy's package shouldn't interfere with mine at all. I have them both installed also.

    Only thing I could think of, other than some huge bug in my code, is that your cache is messed up because of the delete en re-copy of the nodes you just did. This can be fixed by republishing the rootnode, could you try that?

  • Yannick Smits 321 posts 718 karma points
    Mar 31, 2011 @ 15:55
    Yannick Smits
    1

    Hey just noticed that your relateDocumentOnCopy says Parent to Child for direction. This should be Bidirectional by default i think!

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 31, 2011 @ 19:12
    Anthony Candaele
    0

    Hi Yannick, the relateDocumentOnCopy was first set to Bidirectional. Because this didn't worked I set it to Parent to Child.

    I tested again, and changed the setting back to Bidirectional. Than I did a reload nodes and repulbish of the root node and now the LanguageSwitcher macro works !!

    I'm looking forward to the next changes of your package

    greetings,

    Anthony

  • Yannick Smits 321 posts 718 karma points
    Apr 01, 2011 @ 17:04
    Yannick Smits
    0

    Hi Anthony, thanks for testing my package, glad it's all working now. I've done some more enhancements and packaged it up for a v1 release, hope you like it!

  • Eran 292 posts 436 karma points
    Apr 02, 2011 @ 03:59
    Eran
    0

    Hi,

    i admits that i didnt have the chance to test your package yet, but the idea is very nice. thanks.

    feature suggestion:

    when i develop multilingual site, sometime i need to change also some CSS files, when the user pick different language. usually its because each language have different layout - for example hebrew is RTL (right to left) and english is LTR (left to right).

    there are different ways to implemets solution to this problem, and this is just one idea:

    1. create config file that do the mapping between language/hostname and files. for example:
        en --> /css/style_en.css, /css/lightbox_en.css
        he  --> /css/style_he.css, /css/lightbox_he.css

    2. create new macro that read the config file, gets the current language, and loads the right files for this language.

    3. put the macro inside the template that need to do the actual include for these CSS's.

    the result will be that when the user picks language from your language picker, it also reloads the right CSS's for this language.

    What do you think?

  • Yannick Smits 321 posts 718 karma points
    Apr 02, 2011 @ 11:25
    Yannick Smits
    0

    hi Eran, thanks for the suggestion but I don't think it's worth putting that logic in a package as it consist of just 1 line of code.

    You could either do:

    <umbraco:Macro language="cshtml" runat="server">
    <link rel="stylesheet" type="text/css" 
    href="style_@(umbraco.library.GetCurrentDomains(Model.Id)[0].Language.CultureAlias).css" />
    </umbraco:Macro>


    now you can name your css's like this style_en-US.css, style_nl-NL.css.

    Alternatively you could put your language codes in a dictionaryitem, might be faster, not sure.

  • Eran 292 posts 436 karma points
    Apr 02, 2011 @ 14:22
    Eran
    0

    i think that you are right, that should do the job too, as long as you consist this naming convention.

    thanks.

  • Eran Meir 401 posts 543 karma points
    May 16, 2011 @ 12:22
    Eran Meir
    0

    hey, i'm having the same issue
    i get a wrong link, i have the relations in database and they are biodirectional.
    what can i check?

  • Eran Meir 401 posts 543 karma points
    May 16, 2011 @ 12:36
    Eran Meir
    0

    i fixed it, i changed in The Functions File

    the following condtion

    if (GetChildren(masternodeid, masterchildren).TryGetValue(lang.id, out pageid))
                    {
                        data.Url = "http://" + (domains.Where(d => d.Language.id == lang.id)).First().Name + library.NiceUrl(pageid);
                    }

     

  • Yannick Smits 321 posts 718 karma points
    May 16, 2011 @ 15:11
    Yannick Smits
    0

    What did you change? I compared your code with my Functions file but couldn't see any differences.

  • Eran Meir 401 posts 543 karma points
    May 16, 2011 @ 18:59
    Eran Meir
    0

    before the line was

    data.Url = library.NiceUrl(pageid);

  • Yannick Smits 321 posts 718 karma points
    May 17, 2011 @ 22:26
    Yannick Smits
    1

    Don't think this is necessary. Do you have useDomainPrefixes set to true in your config\umbracoSettings.config? This setting should be true for running this kind of multi-node multilanguage setup otherwise you'll end up with duplicate inconsistent urls. 

    Also don't forget to republish your entire site after changing the setting.

Please Sign in or register to post replies

Write your reply to:

Draft