Search code examples
phpcontent-management-systemweb-application-design

How does cushy cms implement its features?


I am curious if anyone can explain how does Cushy CMS implement its features. What I am referring to is adding a class in html , like <div class="cms-editable"></div> and automatically make that div editable and save contents to database. Do they use a parser and write the file? I do not think they save the data to the database.


Solution

  • Cushy is FTP-based, meaning it works directly on your file structure. When you view your website after logging into Cushy's website it is this website interface that pulls in the page you are editing on and inspects the places where the class file exists and makes this an editable item. It uses the FTP credentials you have entered to make the call via FTP protocol to pull in your website pages. It also parses the dom and checks for the class name "cms-editable" and makes this content editable through an HTML editor after some configuration steps after installation. When you make changes and save them, it directly modifies the content area that you defined as editable via FTP again. There are many tools in any server-side language to accomplish this for FTP protocol and DOM parsing.

    The Good thing about Cushy CMS

    • It works for static websites so easily, a designer could set it up.

    The Bad thing about Cushy CMS

    • Its terrible for dynamic websites as your clients are directly editing on your pages and will easily break the website with accidental syntax errors. It does not fit for MVC-style and web programming in general.
    • It requires too much administration after setup as you have to first set an item to be editable on your file directly, then you must give permission through its interface. Imagine doing this for a templated pages being reused. Basically you can't.
    • It cannot handle the same file being edited in different parts at the same time by different users because its actually just a source file being edited upon. Here is where overwrites become an issue when someone saves something thinking they are only saving the part they edited, not realizing they just saved the entire document.

    To give background to my answer, I wrote a CMS tool that is cloud-based and built in a completely different manner than Cushy because its for developers as FTP is a huge limitation when a feed-based approach is much more appropriate. Also, having to log into another website to edit your stuff just sucks. In fact, why even have a back office at all when you have HTML5 client-side editing capabilities and postMessage for cross-domain communication? My profile has more details on this approach.