CornerPixel Blog RSS 2.0

# Thursday, August 06, 2009

You may not be aware, but I started a semi personal semi professional blog and website based on the handle or username I use in most places on the web.  MikePixel is how many of my professional contacts and friends know me by.  I decided to do the blog part of the site in BlogEngine.NET.  I use DasBlog here and have enjoyed it, but I wanted to try something different.

I have enjoyed BlogEngine.NET a bunch, so I will be posting some small helps and hints on how to skin BE. 

Today I will go over the date box I have on the right hand side of the title.  The first thing is to open your PostView.ascx file in the themes directory under the theme you are using for your new skin.

My markup is as follows, with the markup used for the Date Box in red.

<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>

<div class="post xfolkentry" id="post<%=Index %>">
  <span class="pubDate">
      <span class="month"><%=Post.DateCreated.ToString("MMM") %></span>
      <span class="day"><%=Post.DateCreated.ToString("dd") %></span>
      <span class="year"><%=Post.DateCreated.ToString("yyyy") %></span>
  </span>

  <h1><a href="<%=Post.RelativeLink %>" class="taggedlink"><%=Server.HtmlEncode(Post.Title) %></a></h1>
  <span class="author">by <a href="<%=VirtualPathUtility.ToAbsolute("~/") + "author/" + Server.UrlEncode(Post.Author) %>.aspx"><%=Post.AuthorProfile != null ? Post.AuthorProfile.DisplayName : Post.Author %></a></span>
  <div class="text"><asp:PlaceHolder ID="BodyContent" runat="server" /></div>
  <div class="bottom">
    <%=Rating %>
    <p class="tags">Tags: <%=TagLinks(", ") %></p>
    <p class="categories"><%=CategoryLinks(" | ") %></p>
  </div>

  <div class="footer">   
    <div class="bookmarks">
      <a rel="nofollow" title="Index <%=Index %>" target="_blank" href="http://www.dotnetkicks.com/submit?url=<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>&amp;title=<%=Server.UrlEncode(Post.Title) %>">Submit to DotNetKicks</a> |
      <a rel="nofollow" href="mailto:?subject=<%=Server.UrlEncode(Post.Title) %>&amp;body=Thought you might like this: <%=Post.AbsoluteLink.ToString() %>">E-mail</a>
    </div>
    <%=AdminLinks %>
    <a rel="bookmark" href="<%=Post.PermaLink %>" title="<%=Server.HtmlEncode(Post.Title) %>">Permalink</a> |
    <a rel="nofollow" href="<%=Post.RelativeLink %>#comment"><%=Resources.labels.comments %> (<%=Post.ApprovedComments.Count %>)</a>
  </div>
</div>

blogEngine-dateboxAs you notice I have the Post.DateCreated seperated into three different classes.  One for each line of the date box. MMM displays the three letter abbreviation for the month.  dd displays the two digit number day, and yyyy displays the 4 digit year.

Next you will create the CSS that will make the box and float it to the right of the title.

.post .pubDate
{
    background:#BCAFA3 none repeat scroll 0 0;
    border:1px solid #ccc;
    color:#FFFFFF;
    display:block;
    float:right;
    line-height:1;
    margin:0 0 10px 10px;
    padding:5px;
    text-align:center;
    width:40px;
}

.post .pubDate .month,
.post .pubDate .year
{
    display:block;
}

.post .pubDate .day
{
    display:block;
    font-size:20px;
}

.post .pubDate .year
{
    display:block;
}

As a side note, I have text throughout the blog set at 12px. 

body
{
    font-size: 12px;
{

This will make the top and bottom line 12px, and the .post .pubDate .day attribute you see in the CSS code above will set the two digit day to 20px.

You should also set the .post h1 (or what ever header you are using for your blog titles) to be a specific length so that it doesn’t run into the date box.  I have mine set as follows.

.post h1
{
    border-color:#999999;
    border-style:solid;
    border-width:0 0 1px;
    width:450px;
    margin: 5px 0 5px;
    padding: 0px 0px 2px;
}
.text
{
    margin: 15px 0px 0px;
}

You will also notice that I give the blog content a top margin of 15px so that you don’t get text wrap around your date box.  The text of your post will just run under the date box.  The class used for the div with your post’s textual content is “Text”

Conclusion

That is about it.  Have fun skinning your BlogEngine.NET.  They have done a good job of making things easy as far as skinning goes, so make your blog look however you want.  Let’s those creative juices flow!

Thursday, August 06, 2009 2:14:39 AM (Pacific Standard Time, UTC-08:00)

#       Comments [1] - Trackback

BlogEngine.NET | Skinning

# Wednesday, August 05, 2009

I have been setting up a customers MindTouch 2009 site and I ran into an issue where I couldn’t search the contents of the PDF and Office 2007 attachments I had uploaded to MindTouch.

search  I found I could search and find the titles of the documents, but not the contents.

Fortunately I had the #mindtouch irc.freenode.net channel to go to.  The people there are very helpful there.  It turns out that I needed to download and install IFilters for both PDF’s and Office 2007.

They directed me to IFilter.org, and once there I found a whole bunch of links for all different types of IFilters. 

The PDF link brought me to the Adobe site, and the Office Suites link brought me to the Microsoft site.  I downloaded each of the IFilters and then logged onto my Windows Server 2008 box to install.

NOTE:  I found out something interesting though.  It turns out that if you use the Debian/Linux VM’s you will not have any of these issues because they do not have IFilters and use various other tools to those conversions.  I have been told that the IFilters seem to be a better method, but that may be up for argument by people smarter than I.

Once on my server I just ran the IFilters exe files and after both installs went easy, I restarted the server.

Once restarted I went to the control panel under Cache Management and clicked on the “Rebuild Now” button and within a couple minutes all was good and I could now search the contents of PDF’s and Office 2007 documents.

NOTE:  I only had a small amount of attachments and very few pages.  It might take a longer time to rebuild for bigger sites.

I hope this helps any out there who is having the same issues.  I also want to remind people about the IRC support that can be had at the #mindtouch channel at irc.freenode.net.  It is well worth it and they people are VERY patient.

Wednesday, August 05, 2009 10:40:43 AM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

Deki Wiki | Server Administration

# Friday, July 03, 2009

Most of you reading this article are probably saying, “Ya we know DOCTYPE is the first thing you add.”   I mean man it is on the top of the page.

Well anyway just a couple days ago, I had a friend of whom I generally trust his markup skills come to me with a center align issue in IE7.

I took about 5 minutes and combed through the site via Firebug and the Developer Toolbar (kind of like Firebug for IE)  I couldn’t  see any good reason that his main container div should not be centered.

The CSS and markup was right and the parent container element looked like it wasn’t causing any interference.  I have to admit for a minute I was stumped.

Well my last step was to pull out the source markup and check for unclosed div elements.  (I was getting desperate).  In doing this I saw he had no DOCTYPE!  This was making IE7 run in quirks mode.  When my friend added the DOCTYPE his page magically worked the way it was supposed to.

So that you guys and gals don’t make the same mistake, I included below what I should have done in this situation.  (I use the excuse that my friend normally wouldn’t make this mistake, and that’s why I didn’t follow the below steps.)

Okay I should have looked at the markup first and made sure there was a DOCTYPE.  Secondly I should have run the site through validation.

There ya have it.  A small post on the importance of a DOCTYPE.  I hope it has helped.  I also have a couple links below to good DOCTYPE information.

Friday, July 03, 2009 4:46:30 AM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

Browser - IE General | Web Standards

# Thursday, June 04, 2009

I don’t know about you all, but in my Internet Explorer 8, I seem to get dead tabs a fair amount.  I will open up a new tab and type in a URL and it will tell me that it is connecting for; umm, well just about forever.  I have found that if I close that tab and open another it is still dead.  The only way around this is to open up another tab and hope that it would work.  If it didn’t I would have to just open another tab, keeping the old dead ones up.

I also noticed that it was hit and miss, and I could not figure out a pattern.

I was at a point where I was only using Chrome and Firefox on my PC because of this.  I wanted very badly to give IE8 a fair try, but I couldn’t get past this one VERY irritating issue.

Finally I got wise and “Google'd” (maybe I should have “Binged”) the issue and I found an article about it.  The answer is as follows.

It looks like the issue is related to the Loosely-Coupled feature in IE8.  In order to fix this, you will need to brave the registry.  Below are the instructions.

  • Go to Start, type “regedit” in the search box, right click the regedit program, and choose Run as Administrator.
    • You may be prompted to continue.
  • In the registry editor click the arrow to expand a selection.
  • Expand, HKEY_CURRENT_USER,
    • then Software
    • then Microsoft
    • then Internet Explorer
    • now select Main.
  • Check for an option on the right list named “TabProcGrowth”,
  • If it’s there double click on the item and set it to either “0” or “1”  (see below for details).
  • If it’s not there, then you will need to create it
    • Right click on the Main folder (in the left list) and selecting New, DWORD (32-bit) Value.
    • “New Value #” should be created on the right.  You should be able to rename it now to “TabProcGrowth
    • Then double click on “TabProcGrowth” (the one you just created) and set to “0” or “1” as desired (see below).
  • Restart Internet Explorer for this to take effect.

Below is a short explanation to what the choices 0 or 1 do.

Setting this to “0” will cause Internet Explorer to crash entirely if a tab crashes.
Setting this to “1” will allow Internet Explorer tabs to crash and recover without completely closing Internet Explorer.  (I recommend choosing 1)

There is also another good article on IE8 that has to do with this registry setting.

After I did that, my IE8 is actually working as I want it. 

I hope this helps those out there who really want to give IE8 a good fair try.

Thursday, June 04, 2009 10:56:34 AM (Pacific Standard Time, UTC-08:00)

#       Comments [3] - Trackback

Browser - IE8

Archive

<August 2009>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

Email Subscription

Sign up to get the CornerPixel Blog delivered to your email.

About the Author

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In

Statistics

Total Posts: 52
This Year: 3
This Month: 0
This Week: 0
Comments: 28