Copied to clipboard

Flag this post as spam?

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


  • Paul 55 posts 76 karma points
    Dec 16, 2011 @ 22:25
    Paul
    0

    Multilanguage sites - Best Practice

    Hello All,

    I have a trio of questions for your candid feedback as to the best approach.

    I have the following content tree for a mutilanguage site

    en
    page1

    page2

    page3

    ...

    es
    page1

     

    page2

    page3

    ...

    fr
    page1

    page2

    page3

    ...

    Question #1 - I kept the same page name for each page type in each supported language instead of translating the name.  I created dictionary items for each page name to support the multiple languages. So in the umbTopNavigation.xslt I have the following code snippet which resolves the name:

    <class="navigation" href="{umbraco.library:NiceUrl(@id)}">
    <span><xsl:value-of select="umbraco.library:GetDictionaryItem(@nodeName)"/></span>
    </a>

    Is this best practice? or is it better to have the page names translations without having to delegate this to umbTopNavigation.xslt?

    Question #2 - One of the benefits I see with keeping the same page names across the languages is in the umbTopNavigation.xslt I can manipulate the CSS class to change the background color of a specific menu item in order to draw attention to it. But the problem I am having is that the pageName in the template is presented as is (i.e. as page1 instead of Page 1 for both languages) and not with the dictionary items. There is no way to dynamically select the right dictionary item without a specific call to a known dictionalry item which defeats the purpose for a document type that support multiple pages.

    If this approach is to translate all page names prior to the call of the umbTopNavigation.xslt, how do I include css class styles so I can adjust the background color of some of the menu items without the need for a lengthy <xsl:if/> statement like this:

    <xsl:if test="@nodeName= 'page one' or @nodeName = 'de una página' or @nodeName = 'première page'">
            <xsl:attribute name="class">hotMaroon</xsl:attribute>
            </xsl:if>

     in order to keep the css style consistent for the same page type across all the languages?

    Question #3 - I have some pages which I have translated in ASP.NET using Visual Studio as *.resx files, that are brought into umbraco as macros within the templates. Is this best practice or should I go ahead and place the translated content in the content body of the page and forgo the need to have translated content embedded in *resx files that an editor may not have access to in order to modify the page content?

    Thank you for your assistance in this matters.

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 17, 2011 @ 17:02
    Sebastiaan Janssen
    0

    1. Why do all the pages "need" to have the same name? Is it so that you can switch to the same URL but with a different language later? There's no real need to do this, in fact it might even be slightly better for SEO to have the URL be in the local language.

    2. You should change the background of specific menu items according to the nodeTypeAlias, or maybe even a checkbox on your document type. It's not really great to do this by name (remember: your site editors will be able to change the name of the page!).

    3. I would definitely make the content editable from withing Umbraco if at all possible, you KNOW it will change and why would you have a CMS if you can't change the content?

    Hope this helps.

  • Paul 55 posts 76 karma points
    Dec 17, 2011 @ 19:04
    Paul
    0

    Thanks for your response.

    1. I'll follow your suggestion to use different names. I believe it is best for the SEO suggestion you've identified

    2. I added a Datatype ddlb called sheetsyle with default and specific options. Then I check for these options in the umbTopNavigation.xslt and assign the class name appropriately.

    3. I'll follow your suggestion to make the content editable from Umbraco. 

    Thank you for support, it is very helpful.

  • Paul 55 posts 76 karma points
    Dec 18, 2011 @ 05:11
    Paul
    0

    I have a header and footer div that contain links to items in my content tree that I do not present in my Navigation bar using the umbTopNavigation.xslt. These pages are for contact Us, Privacy, Terms which I have reserved for the footer div and Sign Up, Sign in links which I have reserved for my header div.  If pages are to reflect the culture for which they are created, how do I present the correct link to a translation for the Contact us page (which contains a form) within the footer div (already predefined) without using the UrlName property. I believe the UrlName property is used to predefine the page name?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 18, 2011 @ 12:57
    Jan Skovgaard
    0

    Hi Paul

    Could you perhaps post a screendump of how you have structured your content in the content section right now?

    If I have understood the post above correctly you should use dictionary items for everything you plan to hardcode in a template for some reason. The downside to this is that you usually don't let the content editors have access to the dictionary items since they're stored in the "Settings" section, that they should not be granted access to.

    Best practice when dealing with multiple sites is to simply just copy Site 1, when it's done and then use it as a starter for Site 2 where the content can be translated and some pages can be omitted of they don't make since in a lnaguage. Hope this makes sense.

    But would like to see how you structure your content - the structure is key to making it easy to manage the multiple sites.

    /Jan

  • Paul 55 posts 76 karma points
    Dec 19, 2011 @ 12:06
    Paul
    0

    Upon further review, I was able solve the problem by assigning another property called naviagition location which I used as a filter in an xslt. I did not have to specify a urlName for the lnks after all. 

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 19, 2011 @ 13:15
    Sebastiaan Janssen
    0

    Ah, I missed the rest of these posts yesterday, sorry, but that would've been my suggestion as well, great! :-)

  • Paul 55 posts 76 karma points
    Dec 19, 2011 @ 23:08
    Paul
    0

    Yet another kink in my pursuit of a solution.

    (1) I discovered I will have to maintain a sort order for the links to appear the way I want them for each navigation div. If these are unintentionally offset, it will affect where they appear on the page. Is there another way around?

    (2) I was not sure how to include a LoginView in xslt so I've opted for the usercontrol approach for the Top Navigation DIv. I have the following user control which has a LoginView control. How do I get the url and the text resolved for the appropriate cultures without using *.resx? 

    (3) Do I have to define dictionary items for each Text string and NavigateUrl in support of multiple languages?

    If so, how do I incorporate the umbraco code for these into the usercontrol. I assume I'll need the Link to document and nodeName properties for each link. Here is the source of the Top navigation usercontrol.

    <div id="TopLeftSection">
        <asp:Panel ID="PanelAnonymous" runat="server">
            <ul>
                <li><asp:Hyperlink ID="HyperLinkTellSomeOne" runat="server" NavigateUrl="~/TellSomeOne.aspx" Text="Tell someone" ></asp:Hyperlink></li>
                <li><asp:Hyperlink ID="HyperLinkFAQ" runat="server"  NavigateUrl="~/FAQ.aspx" Text="FAQ"></asp:Hyperlink></li>
            </ul>
        </asp:Panel>
    </div>

    <div id="TopRigtSection">
        <asp:Panel ID="PanelAuth" runat="server" >
    <ul>
                <li><asp:Label ID="lblFullNamePrompt" runat="server" /></li>
                <asp:LoginView ID="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <li><asp:Hyperlink ID="HyperLinkSignUp" runat="server" NavigateUrl="~/SignUp.aspx"  Text="Sign up" ></asp:Hyperlink></li>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <li><asp:Hyperlink ID="HyperLinkMyProfile" runat="server" NavigateUrl="~/MyProfile.aspx" Text="My Profile"></asp:Hyperlink></li>
                    </LoggedInTemplate>
                </asp:LoginView>
                <li><asp:LoginStatus ID="LoginStatus1" runat="server"  LoginText="Sign in" LogoutPageUrl="~/Default.aspx" LogoutText="Sign out" /></li>
           </ul>                        
        </asp:Panel>        
    </div>

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 20, 2011 @ 12:13
    Sebastiaan Janssen
    0

    1. Not sure what you mean, if you sort your nodes in the backoffice, they should sort correctly in the frontend as well, right?

    2. You can use Umbraco's dictionary items <%= umbraco.library.GetDictionaryItem("Test") %> (also in codebehind)

    3. For each text string yes, not sure what you mean about the navigateUrl exactly. I have a Razor login macro that might help (this is adapted from the version Jonas did, please give his work an upvote)

    @{ this.Page.AnchorName = this.Parameter.AnchorName ?? "login-form-anchor"}
    
    <a id="@Page.AnchorName"></a>
    
    @helper LoginForm(bool hasErrors)
    {
      <h2 class="noline"><span class="title">@library.GetDictionaryItem("LoginTitle")</span> <span class="secure-icon"></span></h2>
      <form method="post" action="#@Page.AnchorName" class="@(hasErrors ? "error login-form" : "login-form")">
          <input type="text" class="username" name="username" value="@library.GetDictionaryItem("Username")" />
          <input type="text" class="password" name="password" value="@library.GetDictionaryItem("Password")" />
    
          <input type="submit" name="submit" value="@library.GetDictionaryItem("LoginButtonText")" class="submit" />
      </form>
     
    }
    
    @helper LogoutForm()
    {
      <form id="logout-form" method="post" action="#@Page.AnchorName">
        <input type="submit" id="submit" name="submit" value="@library.GetDictionaryItem("LogoutButtonText")"  class="submit" />
      </form>
    }
    
    @helper Message(string message)
    {
      <p>@message</p>
    }
    
    @{
      var isSubmitLogin = (IsPost && Request["submit"] == library.GetDictionaryItem("LoginButtonText"));
      var isSubmitLogout = (IsPost && Request["submit"] == library.GetDictionaryItem("LogoutButtonText"));
    
      var currentUser = Membership.GetUser();
    
      var requestedUrl = Request.Url.PathAndQuery;
      if (Request["ReturnUrl"] != null)
      {
        requestedUrl = Request["ReturnUrl"];
      }
    
      if (currentUser.UserName != "")
      {
        if (!isSubmitLogout)
        {
          @Message(library.GetDictionaryItem("LoggedInAs") + " " + currentUser.UserName)
          @LogoutForm()
        }
        else
        {
          FormsAuthentication.SignOut();
          Response.Redirect(Model.Url);
        }
      }
    
      if (currentUser.UserName == "")
      {
        if (!isSubmitLogin)
        {
          @LoginForm(false)
        }
        else
        {
          string username = Request["username"];
          string password = Request["password"];
          if (Membership.ValidateUser(username, password))
          {
            FormsAuthentication.SetAuthCookie(username, true);
            Response.Redirect(requestedUrl);
          }
          else
          {
            @Message(library.GetDictionaryItem("LoginFailedFor") + " " + username)
            @LoginForm(true)
          }
        }
      }
     }
    
    
  • Paul 55 posts 76 karma points
    Dec 20, 2011 @ 21:56
    Paul
    0

    (1) I am aware they sort correctly, I was of the impression there was another way to present them so someone does not mistakenly offset the sort order.

    (2) That's good news. I will use umbraco's Dictionary Items in the code behind.

    (3) Thanks for the elaborate feedback. I do not know Razor. However I can read through the code to understand it. 

    If I were to use the LoginView control provided by ASP.NET, this will mean I will have to add the NavigateUrl values as dictionaty items for the specific language in order to maintain culture sensitive pathnames. Is this true? By NavigateUrl, I mean the property for the HyperLink control shown in the code below:

    Can this be done using the LoginView Control?

    <asp:LoginView ID="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <li><asp:Hyperlink ID="HyperLinkSignUp" runat="server" NavigateUrl="~/ThisWillBeTranslatedForTheSpecificCluture-SignUp.aspx"  Text="Sign up" ></asp:Hyperlink></li>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <li><asp:Hyperlink ID="HyperLinkMyProfile" runat="server" NavigateUrl="~/ThisWillBeTranslatedForTheSpecificCluture-MyProfile.aspx" Text="ThisWillBeTranslatedForTheSpecificCluture-My Profile"></asp:Hyperlink></li>

                    </LoggedInTemplate>
                </asp:LoginView>
                <li><asp:LoginStatus ID="LoginStatus1" runat="server"  LoginText="ThisWillBeTranslatedForTheSpecificCluture-Sign in" LogoutPageUrl="~/Default.aspx" LogoutText="ThisWillBeTranslatedForTheSpecificCluture-Sign out" /></li>

           </ul>                        
        </asp:Panel>       

     

                   
               
               

                                   
            

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 09:14
    Paul
    0

    I have the following code snippet in which the umbraco.library.GetDictionaryItem() is not resolving to the appropriate string from ASP.NET. What am I doing wrong?

    <div id="TopRigtSection">
        <asp:Panel ID="PanelAuth" runat="server" meta:resourcekey="PanelAuthResource1" >
            <ul>

                 <asp:LoginView ID="LoginView1" runat="server">

                    <AnonymousTemplate>

                        <li><asp:Hyperlink ID="HyperLinkSignUp" runat="server" NavigateUrl="<%= umbraco.library.GetDictionaryItem('SignUpUrl')%>" 

                                Text="<%= umbraco.library.GetDictionaryItem('SignUp')%>"></asp:Hyperlink></li>

                    </AnonymousTemplate>

                    <LoggedInTemplate>

                        <li><asp:Hyperlink ID="HyperLinkMyProfile" runat="server" 

                                NavigateUrl="<%= umbraco.library.GetDictionaryItem('MyProfileUrl')%>" Text="<%= umbraco.library.GetDictionaryItem('MyProfile')%>"></asp:Hyperlink></li>

                    </LoggedInTemplate>

                </asp:LoginView>

                <li class="hide-border"><asp:LoginStatus ID="LoginStatus1" runat="server" 

                        LoginText="<%= umbraco.library.GetDictionaryItem('SignIn')%>" LogoutPageUrl="~/Default.aspx" LogoutText="<%= umbraco.library.GetDictionaryItem('LogOff')%>" /></li>

           </ul>                        

        </asp:Panel>        

    </div>

    They appear as strings like this:
    ...
    <%= umbraco.library.GetDictionaryItem('SignUp')%>
    <%= umbraco.library.GetDictionaryItem('SignIn')%>

    ...

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 09:20
    Sebastiaan Janssen
    0

    Try to change the single quotes to doubles, vice versa. For example:

    <asp:Hyperlink ID="HyperLinkSignUp" runat="server" NavigateUrl='<%= umbraco.library.GetDictionaryItem("SignUpUrl") %>' />
    
  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 09:23
    Sebastiaan Janssen
    0

    Oh and: "(1) I am aware they sort correctly, I was of the impression there was another way to present them so someone does not mistakenly offset the sort order."

    I do not understand what you're trying to do, if your editor is not supposed to change the sort order, you can disable the sort option in their permissions. But I'd say: if the editor feels like the "home" link should be in the middle, then who are we to say he's wrong?

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 11:40
    Paul
    0

    Swaping the all the quotes from singel to double and vis versa did not make a difference.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 11:41
    Sebastiaan Janssen
    0

    Okay, don't know then. Do the dictionary items exist, with the same key? Try to inspect the value in debug and see what's going on.

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 11:44
    Paul
    0

    Yes they do...simply perplexed!

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 11:46
    Sebastiaan Janssen
    0

    Try somewhere in there:

    <div runat="server">
    <%= umbraco.library.GetDictionaryItem("SignUpUrl") %>
    </div>
  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 11:48
    Paul
    0

    setting string aDicItem = umbraco.library.GetDictionaryItem("SignUp"); return an empty string.

    Is the reason behind this problem due to my inability to connect to the umbraco.sdf from VS 2010?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 12:03
    Sebastiaan Janssen
    0

    Shouldn't be the reason, the data is coming from the cache anyway, which is built on app start and if you see your content then your cache is filled correctly.

    Check and double check that the dictionary item is actually called SignUp with a capital S and a capital U:

    Also be sure to restart your webserver just in case something in the cache went bad.

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 12:11
    Paul
    0

    This

    <divrunat="server">

     <%= umbraco.library.GetDictionaryItem("SignUpUrl") %>

    </div>

    does not return nothing.

    I've also checked the Dictionary names.. They are as expected.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 12:14
    Sebastiaan Janssen
    0

    So if the above works, you're adding the dictionary items too late in the request pipeline I suppose, I haven't used usercontrols in AGES so I can't remember where to put them, probably in OnInit or something like that?

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 12:26
    Paul
    0

    I attempted the following to see if Page_Init would make a difference. But it did not

     

            string aTestSample = string.Empty;

     

           protected void Page_Init(object sender, EventArgs e)

            {

                aTestSample = library.GetDictionaryItem("TellAFriend");

            }

            protected void Page_Load(object sender, EventArgs e)

            {

                try

                {

                    //userFullNameInfo();

                    string aTestSample2 = aTestSample;

                }       

                catch (ArgumentException ae)

                {

                    throw ae;

                }

     

            }

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 12:42
    Sebastiaan Janssen
    0

    I've checked an old project and in my codebehind I do this in the Page_Load, have you tried this? (change control's ID and type to yours of course):

                var loginButton = (Button)Login1.FindControl("LoginButton");
                loginButton.Text = umbraco.library.GetDictionaryItem("Login");
  • Adam Jenkin 71 posts 226 karma points
    Dec 21, 2011 @ 13:19
    Adam Jenkin
    0

    Guys, its my understanding that the language used by the dictionary item is retrived by the language bound on the hostname mapping. 

    That means you can only have a one to one mapping between hostname and language.

    Looking at your original post - It appears you are seperating your sites (language variations) by a node (i.e en, es etc) but from a hostname binding perspective they are all on the top level root.

    Shamless plug :p its a problem I am encouting and trying to resolve on this thread http://our.umbraco.org/forum/using/ui-questions/25868-Advice-required-for-best-multilingual-approach

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 13:57
    Sebastiaan Janssen
    1

    @Adam I think I have ran into a similar problem in the past and my solution was to run some code on every page that sets the current locale all the time, got it from here: http://our.umbraco.org/forum/developers/api-questions/11342-Umbraco-overriding-SystemThreadingThreadCurrentThreadCurrentCulture

    Even if you don't set a hostname and language, the dictionary items will still look at the language that is in the current culture so that should not be the problem here. Besides, dictionary items are returning a value, just not in the control Paul is using.

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 13:57
    Paul
    0

    Sebastiaan Janssen, I tried your recommendation:

                    var SignUpLink = (HyperLink)LoginView1.FindControl("HyperLinkSignUp");

                    SignUpLink.Text = umbraco.library.GetDictionaryItem("SignUp");

                    SignUpLink.NavigateUrl = umbraco.library.GetDictionaryItem("SignUpUrl");

    It returned an empty string for both.
    I'll await Adam's research..Hope it will be resolved quickly.
  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 21, 2011 @ 13:59
    Sebastiaan Janssen
    0

    @Paul Replied at almost the same time.. ;-)

    Just to confirm, do you have a hostname set on the root of your site with a language that has a translation for HyperLinkSignUp, SignUp and SignUpUlr?

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 14:51
    Paul
    0

    Yes Sir!

  • Adam Jenkin 71 posts 226 karma points
    Dec 21, 2011 @ 17:43
    Adam Jenkin
    0

    @Seb - Thanks! - That looks promising - I shall take a look.

    @Paul - Might be worth taking a look at some of the code behind dictionary with reflector or on codeplex. Often find I revert to looking at umbraco source to figure out the solutions to problems like this!. (sorry - i know its a rubbish answer :P )

  • Paul 55 posts 76 karma points
    Dec 21, 2011 @ 20:54
    Paul
    0

    I'll take your advice. Thanks for trying!

  • Paul 55 posts 76 karma points
    Dec 22, 2011 @ 07:30
    Paul
    0

    All,

    Upon much labour over the matter, I was able to get the LoginView to work using the umbraco dictionary items. If there is an interest on how I was able to do so, let me know.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 22, 2011 @ 20:29
    Sebastiaan Janssen
    0

    Yes, I am VERY interested in how you got it to work, if only to help out the next person to search for this kind of thing. :-)

  • Paul 55 posts 76 karma points
    Dec 22, 2011 @ 21:56
    Paul
    1

    Since you asked.

    The following may be used for a Navigation Div on a multi-language site. The macro contains a .NET User Control with an embedded LoginView control.

    There are basically 3 sets of steps.

    1. Do the following in Umbraco:

    1. Assign Dictionary Items for each supported language. You will need one for each text associated with the link displayed and the url itself.
    2. Assign Dictionary Items for each Url. For example - the dictionary item for the FAQ link will be FAQ [which will hold the language translations] and FAQUrl [which wll hold the urls to the translated pages for each language]. You cannot use a virtual link. That is you can not place a value like "~/frequently-asked-questions .aspx". You will have to use "/frequently-asked-questions.aspx" without the tilde "~". 

      2. Do the following in Visual Studio or whatever IDE in use:
    3. Create a usercontrol for example HeaderNavigationWebUserControl.ascx containing a LoginView. 
    4. I have included a sample Templated LoginView control below:

    5.         <ul>
                  <asp:LoginView ID="LoginView1" runat="server">
                      <AnonymousTemplate>
                          <li><asp:Label ID="lblFullNamePrompt" runat="server" /></li>
                          <li><asp:Hyperlink ID="HyperLinkSignUp" runat="server"></asp:Hyperlink></li>
                      </AnonymousTemplate>
                      <LoggedInTemplate>
                          <li><asp:Label ID="lblFullNamePrompt" runat="server" /></li>
                          <li><asp:Hyperlink ID="HyperLinkMyProfile" runat="server" ></asp:Hyperlink></li>
                      </LoggedInTemplate>
                  </asp:LoginView>
                  <li class="hide-border"><asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="~/Default.aspx" 
                          LogoutAction="Redirect" onloggedout="LoginStatus1_LoggedOut" onloggingout="LoginStatus1_LoggingOut" /></li>
             </ul>                        
    6.  
    7. In the partial class of the usercontrol  HeaderNavigationWebUserControl.ascx.cs add properties for all the links that will be visible on the page. For example:
      public partial class  HeaderNavigationWebUserControl : System.Web.UI.UserControl
          {
              public string DictionaryItemFAQ { get; set; }
              public string DictionaryItemFAQUrl { get; set; }
       .......
       
    8. My usercontrol also has a LoginStatus control so I have Dictionary Items also specified for the Logout text and Login text.
    9. I was not able to change the Login url associated with the LoginStatus control so I had to assign a UrlName for the Login in page for all supported languages to Login
    10. Assign each property to the respective control using the language of choice. I did this in the page_Init method using C#. Here is an example code snippet:
      protected void Page_Init(object sender, EventArgs e)
      {
      try
              {
                      var FAQLink = (HyperLink)this.FindControl("HyperLinkFAQ");
                      FAQLink.Text = umbraco.library.GetDictionaryItem(DictionaryItemFAQ);
                      FAQLink.NavigateUrl = umbraco.library.GetDictionaryItem(DictionaryItemFAQUrl);
      ....... 
    11. I added events for the Log out link of the LoginStatus control. See code below [This may be overkill].
      protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
      {
                  _currentMember = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
                  umbraco.cms.businesslogic.member.Member.RemoveMemberFromCache(_currentMember.Id); //Not sure if this is not overkill
              }
       
              protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
              {
                  FormsAuthentication.SignOut();
              }
    12. Compile/Build you usercontrol and perform the steps to move the usercontrol and the solution dll to the respective folders of your umbraco site. UserControls in the usercontrols folder and the *.dll in the bin folder.


      3. Do the following in Umbraco: 
    13. In umbraco, add a new macro. For simplicity, I called it Header Navigation. This will be used to reference your just added .NET User Control.
    14. Click Save to save changes made to the macro.
    15. click on the Browse Properties button beneath the .NET User Control entry textbox. 
    16. This will reveal a Browse Propertise dialog containing all the properties you added to the HeaderNavigationWebUserControl.ascx.cs partial class in Visual Studio or whatever programming environment you used to creat the user control. The checkboxes to the left of them should be check.
    17. Click on the Save properties button within the dialog 
    18. A message confirming theaddition of those properties is presented along with a list of the properties just added.
    19. Close the Browse Properties dialog and click
    20. Click on the save icon on the Header Navigation macro page.
    21. Click on the parameters tab on the Header Navigation macro. You should see all the listed properties as parameters. All have a datatype text.
    22. Now within the Sections legend, click on Settings and open the Template folder to reveal the list of templates within your umbraco solution.
    23. Select the template where you want to place the newly created macro.
    24. Add the newly created macro and specify the Dictionary Items without the # [hash].
    25. Save your changes. 
    26. Test your macro for every language supported by your site. It should work as expected.
    Hope this helps someone!

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 22, 2011 @ 22:05
    Sebastiaan Janssen
    0

    Thank you very much Paul for this elaborate explanation, how great of you to spend the time, you rock!!

Please Sign in or register to post replies

Write your reply to:

Draft