Sunday 15 May 2011

mysql - Custom CMS - Storing Content -


I am creating a custom CMS system that will archive articles.

What is the right way to store articles in DB? Given that the article may contain any number of paragraphs or paragraphs and images can be included in it, which are not practical to store each paragraph in a specific area of ​​DB.

I have seen how WordPress posts posts and it appears in a field `post_ content 'to cover raw HTML. Is this an accepted method? By this method I see that the disadvantage is that any HTML mark-up is also collected for each article. If I only store raw text, then the dynamic page that displaces the article will have only HTML mark-up once,

Any ideas?

Thank you.

itemprop = "text">

The area of ​​choice will be a blob type (for example TEXT).

However, which data is a different matter, and actually depends on your implementation, I have worked on similar systems and in the previous archived data it is in the form of:

  • XML - Custom XML tags that are translated and translated by the translation layer in HTML, this method also means that you can make additional inquiries of data from XPATH queries.
  • WMD - Storage data as WMD means that there are no HTML tags that cross site scripting attacks (XSS)
  • HTML is the easiest and fastest of data streaming. The way to sanitize input is to go a long way, XSS and other data that you do not want help, but then it adds more complexity that WMD can solve with differentiation.

    If you are looking for some analytical data associated with images, I would suggest to store the image URI in another table and add it to the URL's primary key ID. This means that you can check image URL copy and not. Image URI can be an identical ID, if you upload and store images within your domain.

No comments:

Post a Comment