Answer the question
In order to leave comments, you need to log in
How to store complex blog post content?
I figured out how to store the contents of primitive posts and articles (consisting only of text) - you enter the date of the post, the author and the text of the post in the appropriate fields of the database record. Then you insert the necessary data from the database into the right places into the article template.
But I don't quite understand how to store the contents of large and complex posts. For example, articles. Suppose an article contains pictures, tables, lists, and even a Google map is inserted in the middle of the article. And another list of tags-categories. How to insert such heterogeneous content into an article template ... or rather, how to store all this in a database, so that later it can be inserted into a template - I have not seen it in any tutorials yet.
Where could I find out about this? What is it called so I can search YouTube myself?
Answer the question
In order to leave comments, you need to log in
any content can be stored using something like BB-code.
For example, a Google map in text might look like [goole_map x=12321312 y=213213213][/google_map]
The same goes for video and tables.
Here on the toaster, posts can also include interactive blocks like JSFiddle or CodePen.
All this is stored in plain text form in the database, and when rendered, it is parsed and converted into a valid HTML code for the browser.
A post/post is a "tree" of unified objects.
You select all these objects and form a "tree", where each object is stored with reference to this "tree", which, in turn, is uniquely linked to a specific publication/post.
Object types: paragraphs, quotes, code blocks, tables, images, external widget codes (displaying information from third-party resources: Google / Microsoft documents, tables, presentations, ..; videos from YouTube, etc.), etc.
PS: The better you initially create content segmentation by object types, the less you will have to redo later.
Yes, in different ways. The main part of the content is stored as html in text fields, but there is related information and it is stored in other tables
Theoretical foundations are to be found in the fundamentals of database design . (or better to read the entire course of IC design).
But without the practice of building and reading database schemas, it will be difficult for you (conceptually, they are built on the basis of ER diagrams). Look for examples of such charts and try to figure out what the tables in them are for.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question