views:

67

answers:

1

The CMS I'm working with uses actual html comments around sections in an xml file to determine what is editable. I'm wondering how this is normally done in other CMSes.

Example:

/about.xml:

<image><!-- :region editable="true": --> <image src=foo.png> <!-- /region/ --></image>
<content> <p>some non-editable html</p>
<!-- :region editable="true": --> <p>bar</p> <!-- /region/ --></content>

The CMS parses the xml file, does a regex based search for the editable areas and picks up whatever is inside the comments, I have the flexibility of specifying html regions that aren't editable.

This probably isn't the most ideal solution but practically its been workable for us, though I've always assumed there was some sort of cleaner way of doing this, maybe having multiple nodes instead of html comments but I really haven't put a lot of thought into this, which is why I'm wondering how your CMS is setup to handle editable regions.

+1  A: 

Many CMS systems work with template files that have placeholder markers for areas in which editable content can be placed, and then they store the actual content elsewhere, simply combining the template and the content when the page is published or served (depending on the setup). Since many pages often reuse the same layout, the template approach offers an easy way to avoid inconsistencies propagating if a layout is changed, et cetera.

Amber
Do you happen to have an example of a template file? I'm assuming the conventions are proprietary for each type of CMS and there's no standard. I've seen the `.tpl` file extension though I've never really dealt with it myself.
meder