So, you want to make a good impression on your customers? Take a critical look at your website and think, “does my front page look like I want it?” Likely you make some compromises because your template requires it. This is all about how to get past that limit and do more with your site!
(Picture still coming)
Allowing Special Default Template
In the 800 eCommerce module, under Setup –> Application Configuration, do a search for HomeTemplate. Set the Config Value to ‘hometemplate.ascx’.

Before You Start
This modification requires the modification, Helpers for Adding Server Side Controls In Interprise 5.6.22
Creating a HomeTemplate
This is something that you can go crazy about, or go really simple. The simple way, take your template.ascx file, make a copy, and rename it ‘hometemplate.ascx’. Here are some common things you would want to do to this page:
- Remove any redundant menus. Some sites have both a menu on the top and a menu on the left. Consider removing one of them.
- Refine your 'skin’ by hand to improve its layout. This is the one page where you can safely do things on a by-pixel basis.
- Remove as much distracting content as possible, make it really easy for your visitors to find what the next step is.
- Start telling a ‘story’ that starts with your home page and ends with your customers placing an order.
Once you get your HomeTemplate clean of clutter, we need to remove the ‘automatic’ content from it. Look for these lines:
- <!-- CONTENTS START -->
- <asp:PlaceHolder ID="PageContent" runat="server"></asp:PlaceHolder>
- <!-- CONTENTS END -->
Delete them.
Promotional Image Rotator
So, now what can we do here? Let’s create an awesome image rotator! Now, I use Telerik controls myself, but I am sure a quick Google search can help you find something free if that’s more your style. I tend to be willing to pay for a product that is supported by such an awesome company.
To use some DataBound controls that use the “System.Web.UI.DataboundLiteralControl”, we have to make a very minor change to the default App_Code\SkinBase.cs file. Find the ProcessControl method and replace it with this one:
- private void ProcessControl(Control ctl, bool includeChildren)
- {
- IEditableTextControl e = ctl as IEditableTextControl;
- if (e != null) e.Text = ReplaceTokens(e.Text);
- else
- {
- ITextControl t = ctl as ITextControl;
- if (t != null &&
- t.GetType() != typeof(System.Web.UI.DataBoundLiteralControl))
- {
- t.Text = ReplaceTokens(t.Text);
- }
- }
- IValidator v = ctl as IValidator;
- if (v != null)
- {
- v.ErrorMessage = ReplaceTokens(v.ErrorMessage);
- }
- if (includeChildren && ctl.HasControls())
- {
- IterateControls(ctl.Controls);
- }
- }
The only difference is that we ignore DataBound types (or at least the one that causes errors). Now that the boring stuff is out of the way. Lets add the control to our hometemplate.ascx:
- <div>
- <telerik:RadRotator ID="Rotator1" runat="Server" Width="750" Height="300"
- ItemHeight="300" ItemWidth="750" ScrollDirection="Down"
- DataSourceID="xmlDataSource1" ScrollDuration="1500"
- FrameDuration="3500" >
- <ItemTemplate>
- <div class="apiContainer">
- <div class="apiContent">
- <a href="<%# XPath("Link/@Url") %>">
- <img src="<%# XPath("Image/@Url") %>"
- alt="<%# XPath("Image/@Alt") %>" />
- </a>
- </div>
- </div>
- </ItemTemplate>
- </telerik:RadRotator>
- <asp:XmlDataSource ID="xmlDataSource1" runat="Server" DataFile="images/ttx/Promo.xml">
- </asp:XmlDataSource>
- </div>
And add the following to the SetupControlsRequiringScriptManager in App_Code\SkinBase.cs (added in the Begin You Begin step) right after the comment:
- // script.Append(SetupServerControl(frm.FindControl("MyControlId") as WebControl));
- script.Append(SetupServerControl(frm.FindControl("Rotator1") as WebControl, " var oRotator = $find(\"Rotator1\")\n oRotator.repaint();\n"));
Getting Data Into Your Rotator
The RadRotator control’s data loading is handled by the asp:XmlDataSource control. As pasted above, the application will load a file located at /images/ttx/Promo.xml, you can change this path to something that makes sense for you, but here is the file format you should use:
- <?xml version="1.0" encoding="utf-8" ?>
- <root>
- <PromoItem>
- <Title></Title>
- <Image Url="/images/ttx/FrontAdXiomInStock.jpg"
- alt="XIOM in stock"/>
- <Link Url="/t-NewsXiomInStock.aspx" />
- </PromoItem>
- <PromoItem>
- <Title></Title>
- <Image Url="/images/ttx/GalaxyRubberComparisons.png"/>
- <Link Url="/t-NewsXiomInStock.aspx" />
- </PromoItem>
- </root>
For each image/add you want to use, create a new PromoItem with the elements/attributes shown. Remember to use alt tags on your images. It is better for your search results AND in some cases, it is the law.
For the Link Url, you can create topics, one for each promotion. You could also just link to a product, category, manufacturer, or whatever you want.
Now, if you run your site, you will notice you have an awesome rotating promotion in your site!
Loading Promo Data From a Topic
But wait, there’s more! How about using a topic instead of an XML file you say? Easy. Change the asp:XmlDataSource to look like this:"
- <asp:XmlDataSource ID="xmlDataSource1" runat="Server" >
- <Data>
- (!Topic Name="PromoData"!)
- </Data>
- </asp:XmlDataSource>
And then add a topic to your website that looks something like this:
(Click to enlarge)

More in the upcoming Part 2!