Reskinning progress

Progress after a day is pretty good.  I had to actually dive into the code a few times with SubText to fully understand how to do the skin properly as it wasn’t straight forward.  I’ll do a post but I think if you really want to do a skin, you’ll have to be able to understand ASP.Net at some level.

Here is a localhost version of the skin after a few hours of hacking.  I still need to do the comment section and properly do the right navbar.  I have to tweak the header a bit too and get the search working too.

image

After this comes me attacking SubText to add in pagination on the home page.  I also fixed, in my opinion, a bug in the PreviousNext control.  I don’t think it is coded properly, but is shouldn’t assume I have to use a worthless control on my page just for formatting.

Here is what they did:

LeftPipe.Visible = false;                            
SetNav(NextLink, entries[0]);

My fix:

if (LeftPipe != null)
    LeftPipe.Visible = false;                            
SetNav(NextLink, entries[0]);

Now the bigger issue is why that control even exists on the control and why they didn’t use FindControl instead of hard coding it in there like the other controls.  An example of what I’m talking about is this from the Header.cs:

if (null != this.FindControl("HeaderTitle"))
{
    HeaderTitle.NavigateUrl = HomeUrl;
    HeaderTitle.Text = Title;
    ControlHelper.SetTitleIfNone(HeaderTitle, "The Title Of This Blog.");
}

This code is far more defensive and doesn’t make the assumption that control is there.  However, I got away with just checking for null.  Here they are far more verbose.  To be honest, I’m not sure why they didn’t just check for null here too as they don’t set the control anywhere from FindControl also.

And yes, I’m fully aware I coded on a Friday night instead of going out.  In my defense, it is cold and very wet outside.

andrew konkol Dec 20, 2008 @ 12:40 PM

# re: Reskinning progress
looks awesome man, can't wait to see it in use.

Post a Comment

Please add 8 and 8 and type the answer here: