Sign in Registration
ruen

How to store content for a site in separate files

Often site owners do not think about how to properly store content for a site, they write it directly on the site in a visual editor. However, this is not the best way, since in order to back up data, all content must be stored in a single standardized format separate from the site, which is easy to produce, edit, store and, if necessary, import content to the site.

kak-hranit-kontent-dlya-sayta

In this case, the content will be stored not only in the site database and in the site file system, but also in universal files. Such files can be easily imported into any information system.

The most convenient format for writing articles for the site is the format of office documents - DOCX. In fact, this is just an archive, device DOCX format and how to open it is described in other articles.

The file itself must consist of pre-compiled sections, for example, at the top of the file there is a table with a description of the material:

- title,

- type,

- category,

- meta tags (minimum keywords and description), etc.

Next, content is placed directly, which usually contains different types of data:

- text,

- images,

- tables,

- other objects.

When the material is written, the file can be easily imported to the site, for this it must be able to do so.

The system must be able to check whether a material exists with this name and type - if so, the material will be updated, otherwise it will be added. The program code usually includes an XML parser that is able to recognize not only content elements, but also their styles for quick transfer to the site. Do not forget about extracting images from DOCX into site folders so that they can be displayed on the site in the material just written. More detailed details of the work of importing content to the site from files will probably be discussed in other articles.

In conclusion, it remains to rename the DOCX file to the name of the article and save it to a specially prepared folder on a computer or other medium, where all data for a specific site is stored. For convenience, such a folder may contain subfolders named by dates in the format: 01.20, where 01 is the month, 20 is the year.

kak-hranit-kontent-dlya-sayta-1

Accordingly, articles written this month can be added to each such folder. Such placement will make it easy to navigate a huge number of articles and, if necessary, find the right one. This is how a site content collection can be organized.

kak-hranit-kontent-dlya-sayta-2

The ease of writing and publishing content on the site, as well as properly structured content storage will serve as an additional motivation to constantly replenish your collection with new articles. After all, to write an article, it will be enough to complete only two steps:

- open a sample DOCX article and write a new article based on your imagination and operating data (of course, if necessary, you may still have to spend time on making images in a graphic editor for an article, or you can just take screenshots);

- go to the site and import into the system (if necessary, for quick indexing, you can also inform the search engines about a new article).

Thus, keeping content separate from the site is a very important part of working on your project. Only this approach will allow you to quickly and easily develop, update and store content for the site. Moreover, the DOCX format is universal, you can develop a parser for any system on which the site is running.

Comments (0)
For commenting sign in or register.
Оставить заявку

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.