Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mac Player

macrumors regular
Original poster
Jan 19, 2006
225
0
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
 
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.
 
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.
 
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.