[CMS] Storing new pages

Discussion in 'Web Design and Development' started by Mac Player, Sep 12, 2008.

  1. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #1
    Hi all im very new the web development scene and I have a doubt about how CMSs store pages created via a web editor, do they store the html in the database or do they write an html file?

    TIA
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    It can vary depending on the CMS in question. The more common (from my experience) that they use a plain text format similar to what MacRumors uses on the forums. Text that is marked up uses the [ ] brackets rather than the < > brackets. So you may have [ B ]bold text[ /B ] that would show the text as bold (extra spaces added inside [ ] brackets so MacRumors didn't really make it bold). This way the content and some styling can be stored in a database, which generally handle plain text very well.

    Some CMS's probably handle storing HTML, but that generally means the CMS has to ensure no malicious code is being stored (dang untrustworthy visitors), which can take some effort.
     
  3. Mac Player thread starter macrumors regular

    Joined:
    Jan 19, 2006
    #3
    Thanks for your insight.

    Isn't saving the text as something like bbcode very expensive for the servers?

    To handle a page request the entire text would have to be parsed and transformed into html.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Yes and no. Parsing the bbcode would be an extra step (the text replacement would be pretty quick and easy though), but there are also extra steps when storing in straight HTML, like validation of the code and checking for malicious HTML. If you completely trusted all the HTML being created by a visitor on the CMS then you could leave out validation, but generally it's still good to have it in place in case an unwelcome person finds their way into your CMS.
     

Share This Page