Al Nyveldt

Adventures in Code and Other Stories

Over the past few weeks, I've received a bunch of questions on using the Quote of the Day widget so I had been planning to put together a quick walk through screencast to show you how to use since I really didn't cover usage very thoroughly in my earlier post.

QuotesInstall Since I was working on a new theme earlier this week, it seemed like the right time to do this, but I also find a minor bug with the control when previewing themes so I made a small change to correct this.  It was a minor fix, but if you are starting fresh or feel like upgrading, I'll include the updated control at the end of this post.

The screencast walks you through adding the widget from download to theme update.  I don't cover making changes to your CSS to make it look the way you want in your theme, but I've tried in in 4 themes already and haven't needed to do anything special to make the widget look right.  I'll include the register and usage line below so you can see them more clearly and don't have to copy notes while watching the screencast.

<%@ Register src="QuoteOfTheDay.ascx" TagName="quote" TagPrefix="uc2" %>


<uc2:quote ID="QotD" runat="server" />

Again, this widget works fine in 1.2 and 1.3.  I'll make an updated version when 1.4 gets closer.  You can download the QuotesWidget 1.0.1 here.

I finally finished up my customizable BlogEngine.NET theme.  I started it long ago to see how easy it would be as well as how much you could actually do within a BlogEngine.NET theme without changing the code base.  I ended up taking the theme much further than a theme should go and decided to scale it back to what you see here.

NonZeroVideo A customizable theme to me is a theme that has options to change the look and display without requiring the user to work with the code pages. 

I went ahead and made a screencast to show you how it looks to an administrator and see exactly what is customizable about this theme.  For those unwilling to sit through the 90 seconds or so, here are the items that can be customized in this theme.

  1. Layout: fixed or fluid (fixed to 1024 width or to fill the screen)
  2. Color: 5 color styles to choose from
  3. Columns: 2 or 3 column layout
  4. Open Text section: Just a title and content box that can be filled in with whatever you'd like to see.  (I use it for an "About Me" section on the sidebar.)

I'm excited to see customizable themes like this mixed with the new widget framework in the next version of BlogEngine.NET.  It will make it a snap for people to make their blogs look exactly how they want.  A lot of the features I had added into this theme originally removing items, reordering, etc, is done much better in the the widget framework that Mads Kristensen has started.

That's it.  Go ahead and try it out.  There are likely some issues with it, so if you find any problems, let me know.  (You are welcome to send me the fix as well.)

Download: Theme-NonZero1.3.zip

Quote1 I love quotes.  I enjoy seeing new quotes and I like to save them if it is handy.  I used to have a text file of quotes I collected, but it was lost in the great hard drive crash of 2007.

As I do enjoy quotes, I made a BlogEngine.NET widget for use in themes for collecting quotes and displaying a new one everyday.  I've been using it for a few months now and I'm finally getting around to sharing it with the BlogEngine.NET community.

"Uhhhh, ok, Al.  So you what exactly are you giving me?"

Great question.  I'm sharing a widget (or control) you can add to an existing theme.  Yes, this will only help someone who is interesting in working on modifying themes.  I'll likely release this theme, Refresh, with the control embedded in the coming days, but until then, you get the widget by itself.  The widget is simply a standard user control (an ascx file) and its code-behind file.

QotDWidget Let me show you how it works.  I made a short (under a minute) screencast showing you how the widget/control works.  For those, to impatient to watch or just completely sick of my screencasts, here is the text version.

As you'd expect, the widget shows you a new quote everyday from your collection of quotes.  It will pick a new quote based on when it was last displayed.  When you are logged in however, it gives you buttons to allow you to add, edit, delete, and navigate your quotes collection.  It is fairly simple.  No admin page, no hassle.  Just drop the control in your theme as you would any user control and it will work for you.

Quote2 "Wow... This is great.  I can just add this to my theme and my quotes will just magically be saved in my blog.  So where are these quotes stored?" 

Another excellent question.  To keep things simple, they are stored in an xml file in your App_Data folder.  Widget data will be provider based in the next version of BlogEngine.NET, but for now it is not.  When the widget is first run, it will find that there is no quotes.xml file and it will create it for you.

One thing I really like about this widget is that it is a simple piece of a theme.  It doesn't require you to install files in different places to use it.  I prefer to keep my blog add-ons as separate as possible from the rest of the blog.  (In other words, I think a theme should stay in its folder and not need files put in other places.  The same should go for extensions as much as possible.  This just makes updating my blog much simpler.)

This widget works fine in version 1.2 and 1.3 and can be downloaded here.

SQLMembership The third screencast in my recent series is a walk through of setting up the SQL Membership and Roles providers in place of the default XML versions.  These SQL providers are built-in to the .NET 2.0 framework and are not BlogEngine.NET components.  BlogEngine.NET was designed to allow using these providers however and is fully supported.

This screencast is a bit longer than the previous two as I start without the membership and roles services in a database and walk you through creating these, checking permissions, setting up your web.config to use them and adding your initial roles and users in the database.

As before, it is available in both an in page flash version and Windows Media Video format.

Here is the web.config updates (for those interested):

[code:xml]



<membership defaultProvider="SqlMembershipProvider" >
      <providers>
        <clear />
        <add name="XmlMembershipProvider"
             type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core"
             description="XML membership provider"
             xmlFileName="~/App_Data/users.xml"/>
        <add name="SqlMembershipProvider"
             type="System.Web.Security.SqlMembershipProvider"
             connectionStringName="BlogEngine"
             applicationName = "BlogEngine"/>
      </providers>
    </membership>



    <roleManager defaultProvider="SqlRoleProvider" enabled="true"
                 cacheRolesInCookie="true" cookieName=".BLOGENGINEROLES">
      <providers>
        <clear />
        <add name="XmlRoleProvider"
             type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core"
             description="XML role provider"
             xmlFileName="~/App_Data/roles.xml"/>
        <add name="SqlRoleProvider"
             type="System.Web.Security.SqlRoleProvider"
             connectionStringName="BlogEngine"
             applicationName = "BlogEngine"/>
      </providers>
    </roleManager>



[/code]

I stress in the screencast, these are the basic entries and lots of options could be added in.  These will get you on the right track however.

In case you missed it above, the links to the screencasts are here:

SQLProvider My second 1.3 screencast is a walk through of setting up the SQL Server provider from BlogEngine.NET.  It starts where the Installation screencast leaves off and takes you through database setup and updating your web.config. 

The SQL Provider setup changed a bit between versions 1.2 and 1.3 making the old screencast incorrect.  I hope to be writing a more detailed post about SQL provider setup in the day ahead.

Anyway, this is a very short video but hopefully someone will find it somewhat helpful.  It is available in both an in page Flash version and Windows Media format.

About

BioPic Hi. My name is Al Nyveldt and I'm a software developer from central Pennsylvania, USA.

I'm on the BlogEngine.NET development team and write on a variety of development related topics. More...

Follow me on Twitter
Contact me via email

Recent Comments

Quote of the Day

"No matter how cool your interface is, less of it would be better."

- Alan Cooper

Sponsor

Recommended Books



Archives


Disclaimer

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

© Copyright 2008

Sign in