Our client wants us to implement change history for website articles. What is the best way to do it?
Our client wants us to implement change history for website articles. What is the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I presume you’re using a CMS. If not, use one. WordPress is a good start.
If you’re developing from scratch, the usual method is to have two tables: one for page information (so title, menu position etc.) and then a
page_contenttable, which has columns forpage_id,content, andtimestamp.As you save a page, instead of updating a database table you instead write a new record to the
page_contenttable with the page’s ID and the time of the save. That way, when displaying pages on your front-end you just select the latest record for that particular page ID, but you also have a history of that page by querying for all records bypage_id, sorted bytimestamp.