1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Developing for Multilanguage Sites

Developing for Multilanguage Sites

13 posts, 0 answered
  1. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    09 Dec 2012
    Link to this post
    Hi guys,

    have someone experience with writing custom widgets for Multilanguage sites ? I have tried the widget selector from Josh, but it is not working in other language as primary language of the whole site. As seen on screenshot, the PageSelector selects Pages in primary language. @Telerik: It will be nice write an article covering the development for Multilanguage sites (selectors, controls, etc.).

    Pavol
  2. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012 in reply to Pavol Kokinda
    Link to this post
    Hi Pavol,

    I'm working on a multilingual site with custom widgets as well. The page selector didn't work for me at first, and the linking option in a HtmlField didn't either. I copied the code generated by Thunder and ended up with this:

    You probably already have something like this in the designer code:
    Protected Friend Overridable ReadOnly Property PageSelectorLinkPageGUID() As PagesSelector
        Get
            Return Me.Container.GetControl(Of PagesSelector)("pageSelectorLinkPageGUID", True)
        End Get
    End Property

    You also need this to set the current culture:
    Protected Overrides Sub InitializeControls(container As Telerik.Sitefinity.Web.UI.GenericContainer)
        If (Me.PropertyEditor IsNot Nothing) Then
            Dim uiCulture = Me.PropertyEditor.PropertyValuesCulture
            Me.PageSelectorLinkPageGUID.UICulture = uiCulture
        End If
    End Sub

    I hope it helps!
  3. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    the sample code from Josh is in C# .... in Designer i have following methods

    protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
            {
                // load in simple mode
                base.DesignerMode = ControlDesignerModes.Simple;

                // set root node for page selector
                
                PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.FrontendRootNodeId;

                // set the image selector type to use string (src)
                ImageSelector.DataFieldType = typeof(String);

                // initialize the taxonomy selectors
                CategoriesSelector.TaxonomyId = TaxonomyManager.CategoriesTaxonomyId;
                TagsSelector.TaxonomyId = TaxonomyManager.TagsTaxonomyId;
            }

            /// <summary>
            /// Gets the page selector.
            /// </summary>
            protected PageField PageSelector
            {
                get { return Container.GetControl<PageField>("PageSelector", true); }
            }

    No PageSelectorLinkPageGUID :(
  4. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012 in reply to Pavol Kokinda
    Link to this post
    Hi Pavol,

    Translated to C# and that sample code I would guess that adding this code below "PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.FrontendRootNodeId;" may work:

    if ((this.PropertyEditor != null)) {
        object uiCulture = this.PropertyEditor.PropertyValuesCulture;
        this.PageSelector.UICulture = uiCulture;
    }
  5. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    i'm running Sitefinity 5.1.3450 SE .... there is no UICulture Property on PageSelector :( .... I have found following Article in Forum. Regarding Telerik Support Staff is a bug on PageSelector ...

    http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/pageselector-pagesservice

    Pavol
  6. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012 in reply to Pavol Kokinda
    Link to this post
    Hi Pavol,

    That's too bad. I hope someone knows a work around in case you can't upgrade. I'm running 5.2.3800. It works there.
  7. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    thanks for your Info. I hope the customer pay a license upgrade and i can continue deliver the "right code" :)

    Greetings,

    Pavol
  8. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    i have tried this with 5.2.3800 SE with no sucess .... the UICulture Property is definitelly missing on PageSelector object !  Have i something omitted ? The PageSelector is of Type PageField in my Designer class.

    protected PageField PageSelector
            {
                get { return Container.GetControl<PageField>("PageSelector", true); }
            }

    Greeetings,

    Pavol
  9. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012 in reply to Pavol Kokinda
    Link to this post
    Hi Pavol,

    You can try to use the type Telerik.Sitefinity.Web.Ui.PagesSelector. That works for me.
  10. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    can you send me the Designer Implementation ? What i need is store some links in custom widget for navigation. I use the PageField for storing the data. My mail adress is pavol.kokinda@gmail.com

    Thanks,

    Pavol
  11. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012 in reply to Pavol Kokinda
    Link to this post
    Sure, I just sent the files. It's in VB.NET, but you can use the Telerik Code Converter to convert to C#. Most of the code has been generated by Thunder.
  12. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    10 Dec 2012
    Link to this post
    That's weird, the mail just bounced with this message: "Remote host said: 552 5.7.0 review our attachment guidelines". I just attached a zip file.

    Can't attach it to this post either. Just images allowed :-(
  13. Pavol Kokinda
    Pavol Kokinda avatar
    39 posts
    Registered:
    28 Sep 2012
    10 Dec 2012 in reply to Arno
    Link to this post
    Hi Arno,

    thanks for your support and cooperation.

    Greetings,

    Pavol
13 posts, 0 answered