Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 778489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:46:18+00:00 2026-05-14T19:46:18+00:00

I need to build some sort of a custom CMS for a client of

  • 0

I need to build some sort of a custom CMS for a client of ours. These are some of the functional requirements:

  • Must be able to manage the list of Pages in the site
  • Each Page can contain a number of ColumnGroups
  • A ColumnGroup is nothing more than a list of Columns in a certain ColumnGroupLayout. For example: “one column taking up the entire width of the page”, “two columns each taking up half of the width”, …
  • Each Column can contain a number ContentBlocks
  • Examples of a ContentBlock are: TextBlock, NewsBlock, PictureBlock, …
  • ContentBlocks can be given a certain sorting within a Column
  • A ContentBlock can be put in different Columns so that content can be reused without having to be duplicated.

My first quick draft of how this could look like in C# code (we’re using ASP.NET 4.0 to develop the CMS) can be found at the bottom of my question.

One of the technical requirements is that it must be as easy as possible to add new types of ContentBlocks to the CMS. So I would like model everything as flexible as possible. Unfortunately, I’m already stuck at trying to figure out how the database should look like.

One of the problems I’m having has to do with sorting different types of ContentBlocks in a Column. I guess each type of ContentBlock (like TextBlock, NewsBlock, PictureBlock, …) should have it’s own table in the database because each has it’s own different fields. A TextBlock might only have a field called Text whereas a NewsBlock might have fields for the Text, the Summary, the PublicationDate, …

Since one Column can have ContentBlocks located in different tables, I guess I’ll have to create a many-to-many association for each type of ContentBlock. For example: ColumnTextBlocks, ColumnNewsBlocks and ColumnPictureBlocks.

The problem I have with this setup is the sorting of the different ContentBlocks in a column. This could be something like this:

  1. TextBlock
  2. NewsBlock
  3. TextBlock
  4. TextBlock
  5. PictureBlock

Where do I store the sorting number? If I store them in the associaton tables, I’ll have to update a lot of tables when changing the sorting order of ContentBlocks in a Column. Is this a good approach to the problem?

Basically, my question is: What is the best way to model this keeping in mind that it should be easy to add new types of ContentBlocks?

My next question is: What ORM can deal with that kind of modeling? To be honest, we are ORM-virgins at work. I have been reading a bit about Linq-to-SQL and NHibernate, but we have no experience with them. Because of the IList in the Column class (see code below) I think we can rule out Linq-to-SQL, right? Can NHibernate handle the mapping of data from many different tables to one IList?

Also keep in mind that this is just a very small portion of the domain. Other parts are Users belonging to a certain UserGroup having certain Permissions on Pages, ColumnGroups, Columns and ContentBlocks.

The code (just a quick first draft):

public class Page
{
    public int PageID { get; set; }
    public string Title { get; set; }
    public string Description { get; set; }
    public string Keywords { get; set; }
    public IList<ColumnGroup> ColumnGroups { get; set; }
}

public class ColumnGroup
{
    public enum ColumnGroupLayout { OneColumn, HalfHalf, NarrowWide, WideNarrow }
    public int ColumnGroupID { get; set; }
    public ColumnGroupLayout Layout { get; set; }
    public IList<Column> Columns { get; set; }
}

public class Column
{
    public int ColumnID { get; set; }
    public IList<IContentBlock> ContentBlocks { get; set; }
}

public interface IContentBlock
{
    string GetSummary();
}

public class TextBlock : IContentBlock
{
    public string GetSummary()
    {
        return "I am a piece of text.";
    }
}

public class NewsBlock : IContentBlock
{
    public string GetSummary()
    {
        return "I am a news item.";
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:46:19+00:00Added an answer on May 14, 2026 at 7:46 pm

    This might not quite be what you’re looking for but…

    I find that using Microsoft Access is a quick way to create a functional database model (although limited) and to test out different query logic.

    Using MS Access would then allow you to create your tables and then try out different iterations of how all the tables/data would link together quickly without needing to write lots of code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some sort of built-in authentication in WCF? I need to expose a
In one of my projects I need to build an ASP.NET page and some
I need to run some precompile steps before I build my project using FlexBuilder.
I need to build a simple, single user database application for Windows. Main requirements
We need to build an administration portal website to support our client/server application. Since
I have a problem: I need to build a custom tag, which can take
I need to build a managed DLL, targeted for x64, and expose it via
I need to build something that starts serving a H.264 encoded video to a
I need to build a simple HTTP server in C. Any guidance? Links? Samples?
I need to build a prototype for an intranet website, and I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.