Adding additional information to the Sitecore login page

In a current project we wanted to show the current build number on the login page. This should help the content authors and testers to easily identify which build is currently running and for which build they have to create issues/bugs on our issue tracker.

I though this is an easy one and just altered the /sitecore/login/default.aspx file with the following content:

<div id="CustomerVersion" class="SystemInformationDivider">
    Customer build: <%=System.Reflection.Assembly.GetAssembly(typeof(MyAssembly)).GetName().Version.ToString()%>
</div>

Today, I’ve learned from Robbert Hock that this isn’t they way of doing this ;-) I heard of the getAboutInformation-pipeline. With this, we can easily add additional information to the right panel of the login page:

namespace Website.Pipelines
{
    public class AddBuildVersion
    {
        public void Process(GetAboutInformationArgs args)
        {
            args.LoginPageText = "Customer build: " + Assembly.GetExecutingAssembly().GetName().Version;
        }
    }
}

And configure the new processor in the web.config:

<configuration>
  <sitecore>
    <pipelines>
      <getAboutInformation>
        <processor type="Website.Pipelines.AddBuildVersion, Website" />
      </getAboutInformation>
    </pipelines>
  </sitecore>
</configuration>

That’s it! If you would like to show a custom text with an image on the login page, there is a Shared Source Module in the Marketplace called Sitecore Partner Aboutinformation Module (contributed by Robbert Hock as well).

Thanks again Robbert for giving me the hint.

Kevin Brechbühl

Senior Developer & Architect | C# & ASP.NET | Sitecore Technology MVP

comments powered by Disqus