SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    967
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Structuring content sub sections

    I'm building a website that has a section for programs within the organization. The content within these pages is mostly the same as content in the rest of the site. The difference is that they have categories used for sorting and have some additional information such as a profile image.

    In addition to standard content, programs will have news and other types of content associated with them.

    I was planning on creating a table for 'programs' that contained the extra information, but keep the program static content within the 'pages' table along with other static content. There will be multiple pages for each program.

    Abbreviated Diagram

    pages
    ---------
    id
    title
    parent
    program_id (default:0 or none)
    content

    programs
    -----------
    id
    pages_id
    title
    profile_image
    category

    Is there any better way to do this? Should program pages be separate from regular static pages. When I think out other tasks, like assigning permissions, it creates complications either way.

  2. #2
    SitePoint Addict webaddictz's Avatar
    Join Date
    Feb 2006
    Location
    Netherlands
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello.

    Quote Originally Posted by eruna View Post
    I was planning on creating a table for 'programs' that contained the extra information, but keep the program static content within the 'pages' table along with other static content. There will be multiple pages for each program.
    Not sure what this has to do with PHP Application Development, but hey. The way I see it, you have two options: either split the programs into a separate table and link to the "base" table, like you proposed, or simply stuffing the extra columns into the page table.

    If there is only a small difference between the content of a conceptual entity "page" and the content of a "program", I'd vote for the latter: just add the columns you need for a "program" to the "page" table. There's absolutely nothing wrong with having NULL values in your database, and it decreases the structures' complexity a lot.
    Yes, I blog, too.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •