Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:09:52+00:00 2026-05-24T00:09:52+00:00

Some examples of light content management systems: CushyCMS Surreal CMS Unify What they have

  • 0

Some examples of “light” content management systems:

  • CushyCMS
  • Surreal CMS
  • Unify

What they have in common is that you just add a specific classname to the parts of your webpage that you want to make editable.
In the backend they somehow save the edited snippets back to the file you edited (no database).

Example of original content and edited content:

Original HTML code

<div class="editable">

<ul>
<li>an</li>
<li>unordered list</li>
</ul>

</div>

Edited HTML code

<div class="editable">

<ol>
<li>an</li>
<li>ordered list</li>
</ol>

</div>

The frontend is pretty clear to me but how would I best go about the backend (PHP)?

I need to make sure that dynamic PHP code keeps working, so I can’t just update the complete file.

Any resources or pointers are very welcome since I have searched for this technique but couldn’t find any in depth ideas or methods of doing this.
The light content management systems listed above aren’t open source so learning from the source is not an option either.

EDIT

I stated that I don’t want to use PHP DOM but things have changed. Both Surreal CMS and CushyCMS are using it, which is a good indicator it is the way to go.

The problem I am experiencing with PHP DOM is that I can’t replace only the part of the original document the user edited.
When loading the original file, PHP DOM will do unwanted things to the document like changing the meta tag, converting single quotes to double quotes, …
Now, for the edited part this is fine, but it is unacceptable for the rest of the document since that should remain untouched (the user didn’t edit this, right).

Cushy and Surreal both seem to know how to stop PHP DOM from touching the rest of the document but I don’t. So if you know, let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:09:52+00:00Added an answer on May 24, 2026 at 12:09 am

    You question is a little vague, but maybe this will help you:

    Part A: Editing

    To edit your lightweight pages, you have to inject some javascript into the page. This javascript searches for all elements with “editable” class and sets them to editable (have a look at the contentEditable property for this as a very basic starting point).

    Keep some identification of the edited element, for example the id, the xpath or the index. To save the texts, just ajax them to your server.

    Part B: Saving to the file

    You might store the pieces in a database, but I assume you want to change the file directly. To do this, you just replace the content of each of the elements with what you received via AJAX. To find the elements in the sourcecode, you will have to use something like PHPs SimpleDOM (this also implies that the HTML pages are valid XHTML).

    Just find the element, write the changes, write the file, done.

    Note, however, that things will become much more complicated if you want to make it work for real projects.

    EDIT: just saw your “PHP code has to keep on working” part of the question. Consider some regular expression magic for this one – replace each /(<?.*?>)/ with a text placeholder (for example “-PHPCODE-$i-“) and after updating the dom tree, replace these placeholders back. Either way, a hard job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying out some examples with analytical functions and i have created a
We have some examples of pictures. And we have on input set of pictures.
I have an ImageButton with a background image that has some transparency. By default,
Can anybody show with some examples the exact difference between .. and ... operator?
Here are some examples of strings (mainly addresses): 12 20 43-B 43-C 123 2500
I was reading some examples on symbols in ruby, and one example was using
I've found some examples of .AVI in html on the web. But my page
I need some examples of implementing curry function in ruby(1.8.6 or 1.8.7 not 1.9).
I want some examples of C preprocessor directives, such as: #define pi 3.14 #define
I'm going through some examples for how to configure asynchronous JMS messaging with Spring,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.