UI Login Settings

UI Login Settings

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings
  • Sitecore.Configuration.Settings.Login
  • Sitecore.Data.Items.Item

Configuration Settings

<configuration>

<settings>

      <setting name="Login.SitecoreUrl" value="http://sdn5.sitecore.net/startpage.aspx" />

      <setting name="Login.RememberLastLoggedInUserName" value="true" />

      <setting name="WelcomeTitle" value="Welcome to Sitecore"/>

</settings>


C# Web Control Code

Sitecore.Data.Items.Item item = this.GetItem();
if (item == null) return;

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
//using &#58; for colon and &#63; for question mark and &#160; for space
output.Write("{0}&#58;&#160;{1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

output.Write("{0}&#58;&#160;{1}", "Welcome Title", "<b>" + Sitecore.Configuration.Settings.WelcomeTitle + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Sitecore Url", "<b>" + Sitecore.Configuration.Settings.Login.SitecoreUrl + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "Remember Last Logged In User Name", "<b>" + Sitecore.Configuration.Settings.Login.RememberLastLoggedInUserName.ToString() + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Login Layout", "<b>Only applies to logging on to extranet domain</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Login Page", "<b>Only applies to logging on to extranet domain</b>");
output.RenderEndTag(); //Div


C# Web Control Real-time Output

Item: UI Login Settings

Welcome Title: The Inside Corner, Inc.
Sitecore Url: http://sdn.sitecore.net/startpage.aspx
Remember Last Logged In User Name? False
Login Layout: Only applies to logging on to extranet domain
Login Page: Only applies to logging on to extranet domain

Notes

  • "SitecoreUrl" specifies the URL of the Sitecore pane on the login page
  • "RememberLastLoggedInUserName" specifies whether Sitecore will remember the last logged in user name on the login page (stored encrypted in a cookie). Default is true. If set to false, the user name field on the login page and change password page will be blank.
  • "WelcomeTitle" specifies the title displayed on the login page. The default is “Welcome to Sitecore”. Update this setting to provide branding.

Sources