Creating a CMS Framework – Update

Spent this weekend working on the cms and made good progress. Got the core page rendering working with masterpages and themes. Tested it with Db and normal aspx pages. I’m wondering whether I’ve over abstracted everything atm!

Just added the security system and user accounts.  Now I’ve got to decide how to expose the account creation side of it. Normally I’ve done that through controls but I’m going to have to create a utility class that devs can use and create their own controls for.

The default BasePage presently does the following:

  • Checks the url and looks for a page in the db using the abstract db layer
  • Gets the page and pulls in the selected master page (or default)
  • Add style sheets and scripts and sets the page title etc.
  • Set the page caching from the db or overrides it if admin user.
  • Builds the body class tags (for page specific styling and js editing)
  • Looks for a ContentPlaceHolder called content and adds the context text, if its not found the content is added to the form controls.

Nothing complicated but that’s as far I want the default functionality to go.  I’m going to add content blocks etc. by creating new basepage classes.


The HeaderManager is a utility that allows devs to easily add css and script to the page.  It handles external style sheets and style blocks(media aware), external scripts and script blocks. It allows you to just add what each control/page needs without worrying about generating duplicate entries.

What’s Next

Now I’m going to break it 🙂 I want to start with the MySql layer straight away so I can see what issues arise before I get in too deep; Create the user utility class to easily enable devs to create and manage accounts; Create a utility class to make working with normal content place holders easy.

2 Responses to “Creating a CMS Framework – Update”

  1. fbis says:


    I’ve spent all weekend trying to create the MySql database and it has driven me insane! I keep getting a ‘1064’ error whenever I try to create various stored procedures! Informatively, that error message means ‘somethings’ wrong, not WHAT’S wrong, just something!

    No useful error to point you in the right direction. More annoyingly, if you use a different MySql program (Administrator, Query) it will work in one but not the other!

    ARGGGGHHH! Flaky!

  2. fbis says:

    Progress so far….

    Got a bit distracted with trying to create a ControlDesigner (unseucessfully atm.) but have got some more stuff done.

    HeaderManager – Added javascript management that allows controls to add script includes to the header section or the normal ScriptManager. Also added basic script coalition and compression which I need to test.

    BasePage – The base page now handles 3 modes of pages. DB Only, ASPX only and Mixed. DB only pulls all data from the db, ASPX only handles pages that are not in the db and Mixed handles physical pages and merges the Data, Scripts etc from the database entry. It also appends the DB.Content at the specified index.

    Had a bit of a culture shock trying to convert StoredProcedures to MySql but kind of figuring it out. Best thing is my DataAccessLayer was designer to be database independent and I never tested it till now but it worked seamlessly, not a single code change 🙂

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.