More in this section

Forums / Developing with Sitefinity / custom languagebar, horizontal hyperlinks

custom languagebar, horizontal hyperlinks

4 posts, 0 answered
  1. Philip
    Philip avatar
    8 posts
    Registered:
    16 Jun 2008
    04 Aug 2008
    Link to this post
    Hello,

    I am trying to create a custom languagebar, but with no succes.
    What I am trying to do is the following:
    I have created a multilanguage website, added the languages to web.config and tested it with the default languagebar.

    web.config:
       <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="nl" cultures="nl, en, fr, de">

    Now I am trying to redesign the language bar to show as follow:

    (horizontal hyperlinks)
    Dutch | French | English | .... (showing all languages exept the current language)

    I hope you can help me achief this with a custom control?

    Thank you in advance !!!





  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    04 Aug 2008
    Link to this post
    Hello Philip,

    Thanks for contacting us.

    The LanguageBar control uses a Layout template for its presentation. The Layout template is a property of type ITemplate. You have to set it in code and tell the language bar to use a LanguageList as a template. For more detailed instructions, please read this forum post on making foreign language horizontal hyperlinks.

    I hope that I have given you clear instructions on adding this functionality to Sitefinity. Feel free to contact us if you have any questions.

    Best wishes,
    Joe

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Philip
    Philip avatar
    8 posts
    Registered:
    16 Jun 2008
    05 Aug 2008
    Link to this post
    Hello Joe,

    Thank you for your fast reply and help.
    I have followed your instructions to change the languagebar to use the languagelist.

    I added languagelist.cs to the app_code folder
    I added the control languageflaglist to the website via the admin console.
    I changed the languageflaglist.ascx.cs to use the languagelist:

        private class DefaultTemplate : ITemplate
        {
            public void InstantiateIn(Control container)
            {
                // initialize the LanguageBarList
                LanguageList list = new LanguageList();
                // set the ID so that it is recognized by the container
                list.ID = "languageList";
                list.CssClass = "langList";
                container.Controls.Add(list);
            }
        }

    But I now get the error:

    c:\Inetpub\wwwroot\sitefinity\WebSites\testproject\UserControls\Custom\LanguageFlagList.ascx.cs(31): error CS0433: The type 'Telerik.Localization.WebControls.LanguageList' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\926bad1f\cb34477d\assembly\dl3\52d5631e\00b1d019_a0ccc801\Telerik.Localization.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\926bad1f\cb34477d\App_Code.wgndaumt.dll'

    When I remove the languagelist.cs from the app_code folder everything works.
    But I need the languagelist.cs file to make further changes.

    I hope someone can help me with this.

    Thank you


  4. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    05 Aug 2008
    Link to this post
    Hi Philip,

    When ASP.NET first compiles a page, it makes an assembly out of it and places it in your Temporary ASP.NET folder. If the page runs without errors, then that assembly is deleted. Since you are doing some custom development, an error was likely made and that assembly was not deleted. To remove these temporary files, follow these instructions:
    1. Navigate to the following directory on your computer: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
    2. Delete all the contents of that folder
    You might get an error that some of the files in this folder are still in use. Please restart your computer and delete these files as soon as Windows starts up. I hope that this solves your technical issue. Feel free to contact us if you need further assistance.

    Thanks,
    Joe

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered