There is no need to create a separate table for pictures. You can use a rich text editor to edit news content, upload pictures, etc. The pictures are saved in the website directory, and the img in the html is linked to the corresponding picture file in this directory
What is the interpolation method? Randomly inserted like an article? Or are there certain regular intervals? If it is like an article, you can use an editor like kindeitdor which is great
HTML is designed in such a way that when visiting a website, only one HTML file will be returned. But what about images (img) in HTML? He will re-initiate a request. So, just save the news directly in your data table. As for the picture, you save the picture locally (or in the database), and then use <img src="image address"> to replace the picture. When you get this news, look for <img> in it, get the picture, and then replace it in the news.
The above idea is applicable to all terminals. If you are developing a website, then the browser will help you solve the search and replace step.
If the pictures in your article need to be used in other articles or other places (that is, when the image address in the site is allowed to be used), you should use a field to store all the image addresses in the article
Then as mentioned above, if your front-end is a rich text editor, don’t worry about the pictures. The pictures will have an address after they are uploaded to the website directory or cdn specified by your back-end. Then you only need to add this whole Type the thing into json and save it to the article_json above (of course I picked a random name here, you can choose it yourself). When displaying and calling in the future, just read out the json and display it directly.
There is no need to create a separate table for pictures. You can use a rich text editor to edit news content, upload pictures, etc. The pictures are saved in the website directory, and the img in the html is linked to the corresponding picture file in this directory
What is the interpolation method? Randomly inserted like an article? Or are there certain regular intervals? If it is like an article, you can use an editor like kindeitdor which is great
HTML is designed in such a way that when visiting a website, only one HTML file will be returned. But what about images (img) in HTML? He will re-initiate a request.
So, just save the news directly in your data table. As for the picture, you save the picture locally (or in the database), and then use <img src="image address"> to replace the picture. When you get this news, look for <img> in it, get the picture, and then replace it in the news.
The above idea is applicable to all terminals. If you are developing a website, then the browser will help you solve the search and replace step.
kindeditor or UE can be used, directly html
If the pictures in your article need to be used in other articles or other places (that is, when the image address in the site is allowed to be used), you should use a field to store all the image addresses in the article
I think you should design an article table with the following fields
Then as mentioned above, if your front-end is a rich text editor, don’t worry about the pictures. The pictures will have an address after they are uploaded to the website directory or cdn specified by your back-end. Then you only need to add this whole Type the thing into json and save it to the article_json above (of course I picked a random name here, you can choose it yourself). When displaying and calling in the future, just read out the json and display it directly.