-3

I have created a website for a third party, who have no experience in editing HTML. However, the third party wishes to be able to edit the content on the website without having to open the files and edit it this way, they wish to do it somewhat WYSIWYG (For example, hit an "edit" button for the content they wish to edit). Is this possible to achieve? It is not an internal website, it has user tracking (this should obviously only be available to admin users).

Is there a way of making contents of a div editable, then saving the change directly to the server, so the content gets updated publicly?

I am currently researching the topic, and although I have found some indications that the solution may be a PHP script, I have yet to find any definitive solutions or examples of similar functionality.

Noroz
  • 1
  • 2
  • 1
    Take a look at https://wordpress.com – JBis May 29 '19 at 17:31
  • 1
    Possible duplicate of [Save current page as HTML to server](https://stackoverflow.com/questions/3775281/save-current-page-as-html-to-server) – Randy Casburn May 29 '19 at 17:31
  • 2
    Yes, it's possible, but showing how you do it is far too broad for SO's Q&A format. Wordpress and other CMS's do this. How they do it varies, but basically you store the content somewhere (a database, the filesystem, sometimes both). The server accepts updates from the client (after authenticating the user), does sanity/security checks on it, and updates the database and/or file system. – T.J. Crowder May 29 '19 at 17:32
  • A pre-built CMS is the easiest and fastest way to get what you want. However, if you insist on a custom app then look into editable content areas and other WYSIWYG tutorials. https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content – daddygames May 29 '19 at 17:35

1 Answers1

0

Yes you will need a backend language or framework to archive this. Where Javascript is used to interact with the page, the actual storage of information requires a database or similar technology.

Unfortunately which backend language or framework to choose really is the million dollar question. It largely depends on exactly what you are trying to accomplish, what your client or user is comfortable with, and how much experience you have programming.

PHP is fast and time tested backend language. Node is the new kid on the block, and it very popular also. Java and dotNet are on the way out. You can dig up a bunch more including Go, Python, Haskel, Etc.

You can use a languge listed above and start scripting away, but this can be time consuming and error prone. Most people use a framework to get started, and program using that framework's tools. The most popular PHP framework is WordPress, but it is designed for blogs and might not fit your use case. I use the framework Craft CMS which is very customizable. But the way you are phrasing the question a framework might be overkill. This is really up to you to decide after doing research into the available options and comparing them to what you wish to accomplish.

For the WYSIWYG, you might want to look into the following tools for the client to edit content:

  1. https://imperavi.com/redactor/
  2. https://ckeditor.com/

Hopefully this provides some direction, happy coding!

Clark Nelson
  • 171
  • 1
  • 6