Simple Content Management

Don’t be fooled by the title: this article covers the implementation of a complete, expandable, client-side content management system using REBOL.  This system makes it easy for any website operator, regardless of experience, to update site content while keeping markup valid and consistent and ensuring that links stay pertinent.

Article Continues Below

Why another CMS? I’m not a fan of the client-side content management provided by FrontPage or Dreamweaver, and server-based systems rely on server OS and software and are vulnerable to the restrictions of hosting packages.  This CMS will work on any desktop system.

What you’ll need#section2

Your content editors will need to be able to modify a text file, understand a few markup rules, and should have a little double-clicking experience.

You, the web designer and provider of code, should have a little scripting experience and a copy of the scripting language REBOL.  The core language runs on over 40 platforms and is available from their downloads section. To run the code in this article, you just need to follow the installation instructions for your platform, which is usually no more arduous than unpacking a Zip file.

REBOL may be new to many of you, so I’d suggest a quick look at some of the excellent language primers on their site, though you may find it just as easy to learn by example.

Your content file#section3

All content for your site is stored within a single text file, which I’ll name content.txt.  This file uses simplified markup rules I have defined myself, and the contents of the file will look something like what’s below. (Note: Some lines have been wrapped to fit this page. View the linked document for easier study and greater accuracy.)

Site Title: Business, Inc.New Page: Products (products.html)===Business, Inc. ProductsBusiness, Inc. has an **excellent** reputation 
in the world of office supplies. Our specialties 
include:...Paper Clips...Staples...Pen HoldersBuy online: ##http://oursite/store/##Business, Inc. Store##.

This simplified markup (which you define) is all the content editors need to use to keep their site up-to-date.  Note: every declaration, heading and paragraph is on a single line, so a word-wrapping text editor is a must.

At the top of the file is the title of the site – this will appear between the <title> tags.  Headers are defined by === (three equals signs) at the beginning of the line, lists by ..., and every other line is a regular paragraph.  Inline formatting includes wrapping some text with two **s to emphasize it and hyperlinks go ## url ## text ##.  I also have special markup for images, though it is beyond the scope of this article to explain their implementation.  Needless to say, it probes the image for its size attributes.

One script fits all#section4

To begin the REBOL script, first we need to create a text file called content-management.r  (or anything ending in .r).  At the top of the file goes:

REBOL [
 author: "Christopher Ross-Gill"
 rights: "Chris and ALA readers"
]

The REBOL header provides much scope for describing your scripts.

Now we can load in the content.

content-block: read/lines %content.txt

I’ve used the /lines refinement of read to split the file by line endings (file names in REBOL have a ‘%’ prefix and use ‘/’ for directories – no matter what the platform).  We’ll end up with a block (like an array) of strings.  We just need to zap all empty strings from content-block. {Line wraps are marked thusly: ». – Ed.}

while [empty-string: find content-block ""]»
 [remove empty-string]

Parsing the content#section5

Extracting structure from our document is made easy with the parse command.  This next bit of code defines structure as an empty block, then loops through content-block exposing each string to the rigors of the parse rule, filling structure with the processed, organized content.

structure: copy []foreach paragraph content-block [
 parsed?: parse paragraph [
  "Site Title:" copy para to end
  (repend structure ['site-title trim para])
  |
  "New Page:" copy para to "("
  skip copy id to ")" skip
  (repend structure ['h1 trim para id])
  |
  "===" copy para to end
  (repend structure ['h2 para])
  |
  "..." copy para to end
  (repend structure ['li para])
 ]
 if not parsed? [repend structure ['p paragraph]]
]

Notes on the rules: In REBOL, a parse rule not only describes the structure of a string, it also instructs the program what to do with the extracted values – these instructions are stored in the parentheses.

Taking the first rule as an example, it looks at the beginning of the string for the text “Site Title: “ then sets the word (like a variable) para to the rest of the string.  It then appends the structure with the word site-title and the string para.  Alternate rules are separated by the | character.  If none of the rules match, we append the string with the word p.  The structure block should look something like this (for more complex strings, REBOL uses curly brackets {}):

[
 site-title "Business, Inc."
 h1 "Products" "products.html"
 h2 "Business, Inc. Products"
 p {Business, Inc. has an excellent reputation 
in the world of office supplies.  Our specialties include:}
 li "Paper Clips"
 li "Staples"
 li "Pen Holders"
 p {Buy online – »
 ##http://oursite/store/##Business, Inc. Store##.}
]

Inline formatting#section6

Before we go punching our content into an XHTML template, we’ll set up a paragraph formatter.  This function deals with punctuation, special characters, links and emphasis.

format-text: func [text [string!]][
 replace/all text {&} {&}
 replace/all text { "} { “}
 if (first text) = #"^"" »
 [replace text {"} {“}]
 replace/all text {"} {”}
 replace/all text { '} { ‘}
 if (first text) = #"'" »
 [replace text {'} {‘}]
 replace/all text {'} {’}
 replace/all text {--} {–}
 replace/all text { – } {–}
 replace/all text {.  } {.  }

The collection above of replaces gives us curly quotes, em dashes, et al.

 parse/all text [
  any [
   thru {##}
   copy link to {##}
   2 skip
   copy hlink to {##}
   (
    href: {<a href="}
    nlink: link    replace text rejoin [
     {##} link {##} hlink {##}
    ] rejoin [
     href lowercase copy nlink{} hlink {</a>}
    ]
   )
  ]
  to end
 ]

This parse rule can be more complicated, e.g. it can detect email addresses and external links.  The any at the beginning of the rule indicates that there may be none or more links within a paragraph (as opposed to some which would imply one or more links).

 parse/all text [
  any [
   thru {**} copy emphasized to {**}
   (
    replace text rejoin [
     {**} emphasized {**}
    ] rejoin [
     {<em>} emphasized {</em>}
    ]
   )
  ]
  to end
 ]

A simpler version of the hyperlink rule.

 replace/all text {@} {@}

As an anti-spam measure, this replaces the ‘@’ symbol with its associated entity reference number.

 return text
]

Thus concludes the format function.

Your XHTML template#section7

The template can be taken care of easily.  Prepare your XHTML document and save it as template.html, putting placeholders for the page title and the body. A minimal template is below. The linked document is invisible in your browser until you view source, which should look like this:

<html><head>»
 title><% page-title %></title></head>
<body><% page-body »
 %></body></html>

Placeholders need only be unique in construction; they don’t necessarily need to be an XHTML tag.

punch-template: func [
 site-title [string!]
 page-title [string!]
 page-menu [string!]
 page-content [string!]
][
 template: read %template.html
 replace template <% page-title »
 %> rejoin [site-title ": " page-title]
 replace template <% page-body »
 %> rejoin [newline page-menu newline page-content newline]
 return template
]

That is our function to replace the placeholders.  Yep, it’s that simple.

Putting it all together#section8

So let’s review what we have up to now: content, stored as structure; formatting guidelines, stored in the function format-text; and a template, stored in the function punch-template.  To put everything together, we need to add two more stores to our script: one for individual page contents with associated file names, and a string to store the menu code.

pages: copy []
menu: copy ""

Now we can wrap up the content from within a single parse rule – remember, code can be run from parentheses within a parse rule.  Since we’re parsing a block as opposed to a string this time, the rule looks slightly different:

parse structure [
 (append menu <div id="menu">)
 'site-title set title string!

Remember the structure block?  Our parse rule is stating that it must begin with the word site-title followed by a string.

 some [
  'h1 set header string! set id string!
  (
   repend menu [
    newline <p> build-tag compose [
      a href (id)
    ]
    format-text header </a> </p>
   ]
   content: copy ""
   repend content [
    newline <div id="content">
    newline <h1> format-text header </h1>
   ]
   list?: false
  )

When we come across an h1, we are really defining a new page.  So we add a reference to the menu.  Then we make a new string for this page and insert a <div id=“content”>.  Then we paste in the heading.  The final task is to turn the list? flag off.  We’ll come to this soon.

  some [
   'h2 set para string!
   (
    if list? [append content </ul> »
  list?: false]
    repend content [newline <h2> »
  format-text para </h2>]
   )
   |
   'p set para string!
   (
    if list? [append content »
  </ul> list?: false]
    repend content [newline <p> span class="linewrap">»
  format-text para </p>]
   )
   |
   'li set para string!
   (
    if not list? [repend content »
  [newline <ul>] list?: true]
    repend content [newline <li> »
  format-text para </li>]
   )

This covers the rest of the formatting.  list? allows us to check when we have to add the <ul> tag.  When we come across an li and list? is not true, we set list? to true and add a <ul>.  Likewise, if list? is true when we come across a header or paragraph, we insert the </ul> tag and set list? to false.

  ]
  (
   if list? [append content </ul>]
   append content </div>
   repend pages [to-file id content]
  )
 ]
 (append menu </div>)
]

That should fill our pages block and menu string nicely.

Publishing#section9

To finish up, we just loop through the pages block, and everything we need to put the site together is there.  REBOL treats files and ftp urls in the same way, so you could quite easily replace %pages/ with ftp://user:pass@somesite.org/pages/ to write the pages directly to your web server – the complete content management system.

if not exists? %pages/ [make-dir %pages/]foreach [file content] pages [
 write join %pages/ file punch-template »
 title header menu content
]

Save the script.  Place in the same folder as content.txt and template.html and execute the script.  A new folder called pages will appear, containing, if you followed my example, products.html.  Try adding new pages to content.txt or try adding your own formatting rules.

This script can form the base of a much more powerful and complex client-side content management system.  More complex formatters exist in REBOL, such as Make-Doc-Pro or the HTML Dialect.  An article on how REBOL blocks work is available at REBOL Forces.

About the Author

Chris Ross-Gill

Chris Ross-Gill is a freelance designer of web sites, UIs, icons, and print documents. His interest in REBOL extends beyond mere scripting into the realm of online collaboration with their Internet Operating System. His home page, ross-gill.com, reflects his roots in the Scottish islands.

49 Reader Comments

  1. Is it just me but does it seems rather wierd to suggest people to invent their own mark-up language (** === ## a.s.o) when we have a good fleksible mark-up language which is called XML?

    I know this may only be an example and you could use whatever text string you want, but still i somehow makes my eyes hurt 🙂

    Best Wishes
    Oscar Eg Gensmann

  2. I’m skeptical of the value of a “roll-your-own” how-to article which deals with a proprietary (and not free) language… especially one which, as Oscar pointed out, doesn’t play nice with pre-existing standards. Then again, perhaps I’m just being totally ignorant and there’s millions of REBOL users out there… but I’ve never come across it before. Disappointing.

  3. Err… REBOL? Who uses this? Why not pick a language thats opensource like PHP, and that is on almost every good host in existance? I saw the title for this article and got excited. I’m article seems fine in and of itself. Just not very useful. Try http://www.evolt.org/user/eli/9186/index.html
    The build a nice lil CMS in php w/MySql.

  4. I’m not sure I understand the purpose of rolling my own CMS when there are over a dozen such systems available which are far more robust, functional, and free. These systems are often bult upon standards and widely-used open source technologies. I understand this is “Geek Week”, but smart geeks know there is no point in re-inventing the wheel.

    Here’s a list of free CMSs:
    http://clueful.com.au/cgi-bin/cmsdirectory/browse/Products%3AFree%20systems

  5. A couple of points in defence of REBOL…

    REBOL is (mostly) free.
    REBOL/Core (which is all this article requires) and REBOL/View are free downloads. REBOL/Command, REBOL/ViewPro and REBOL/IOS are commercial products.

    REBOL does play nice with pre-existing standards.
    It supports a large number of internet protocols and allows you to “roll your own”. It also supports XML.

    And in defence of the article, the whole point is that this is a “CMS” which makes no assumptions about your server, instead generating flat pages on your development machine rather than dynamically on the server. That means PHP, ASP, Perl, JSP or whatever are not really alternatives – where as REBOL provides probably the easiest way of building an app to fulfill this task.

  6. The first poster pointed out that we already have XML. I wanted to add to this in case anyone was wondering where to go from there. XSLT is similar to the per-element replacement rules the author is suggesting you do in REBOL. But XSLT is a W3 standard, free, and there are more than one companany and invididuals making processors for it.

    XSLT is understood natively by both Internet Explorer 5 and Mozilla, so you can either deploy it on the browser side, client side (your development machine, making it spit out static HTML ready-to-be-hosted), or the server side. In fact, since its a standard, you can begin with a client side system, and then use exactly the same templates should you upgrade to a hosting service that offers an XSLT processor on the server (and there are now several pieces of software which do this, like Apache Cocoon and Apache AxKit).

    XSLT is the _only_ templating system that can live comfortably on all three points of the development/hosting/browsing pipeline.

    Throw in a browser sniffer, and you can even deliver raw XML to Internet Explorer/Mozilla and have it format your page into HTML on your visitor’s CPU time instead of yours.

    XSLT is as simple to learn as REBOL, and is more likely to be supported by advanced web site editors (maybe future versions of Dreamweaver and Frontpage, if they don’t already) than a proprietary system.

    But if that’s not enough, a critical advantage of XSLT is that it comes with XPath. With XPath you can look anywhere in the source document from anywhere in the template using a simple, URL-ish addressing scheme. So, for example, say you want a button at the top of the page to turn on “Director’s Commentary” for your weblog/essay/novella, but you don’t want that button to appear if the document doesn’t contain any tags in the XML. All you need to do is use XPath to see if there are any tags up ahead before you actually include the button. Same can be applied to a dozen conditional menu links or UI elements, set both ahead of and after the body of the content iself.

    In my practice, I’ve also found that XPath is invaluable for filling the TITLE atribute on links. When I get to an element I just look ahead to the glossary section I’ve included in the XML source and suck that information out.

    XPath also understands full URLS. If there’s an XHTML or XML resource on a web page elsewhere, you can suck in all or fragments of it while you’re building the template and include its contents in your own document’s XML tree. It’s as simple as:

    Temperature in New York:

    That is ease and power I think anyone can respect.

    There’s more about XSLT and XPath at http://www.w3.org/Style/XSL/

  7. I’m a roll-your-own kinda guy.
    For example, IIS has no analog to Apache’s mod_rewrite. So I’m trying to write one for IIS.

    But I also read this article very skeptically.

    I agree w/ the previous comments on XSLT’s superiority.

    The previous poster suggests that you can “throw in a browser sniffer, and you can even deliver raw XML to Internet Explorer/Mozilla and have it format your page into HTML on your visitor’s CPU time instead of yours.”

    A little further down the pike, I think it’s also important to keep in mind that HTML may be dated. One of the end goals of XSL FO (related to XSLT) is to specify rendering for XML elements (rather than having to adapt it into HTML).

    The great benefit of doing this is that the semantic of the original XML markup is retained, instead of factoring down to a less-meaningful HTML, which has a generalized structure.

    This change in the design of the web will allow a single resource to be both human and machine readable.

    Of course, you can take my comments with a grain of salt, as poor as my page is right now. 🙁

  8. Or we can continue using any other data storage (sql etc) system + processing system which is oh so much more efficient and less time consuming.

    For clientside processing this is also almost useless. It relies on built content files. That means we need to create scripts that build these special flat files. Why build straight to html, skipping the middle man, as it is the same amount of work? Data changes, build it once, done. Use xml if you have to.

    I see no valid reason for the use of it – unless its an evil way to insure job security.

  9. Leo,
    It’s fine for you to continue using some efficient data storage mechanism today.

    I don’t think anybody really argues about how you should store your data _on_your_server_. That’s up to you. It only really matters when you start exposing it as a resource on the web.

    As the semantic web emerges, existing databases, with their proprietary interfaces, will not be able to interop as well as an XML-based system.

    More and more, I am pondering the wisdom of relational databases. I suspect that in the near future, OO and XML DBMSs will become more accepted.

    SQL Server 2000 allows you to select XML based on a table. This is neat, but the current implementation is far from complete. It is possible that Microsoft has the foresight to add more complete XML support, but I am not so sure.

  10. I know it’s a minor point, but don’t forget that another plus for XSLT is that the output is technically XHTML, not HTML, which is really just HTML with Great Table Manners. In my day-to-day work, that’s been the biggest benefit of my XML/XSLT projects – the fact that it has very little choice but to create the kind of well-formed HTML that makes developers drool. I hand-code all of my creative side projects, but there are many days when I go into mass production of web pages like a factory worker and I have no choice but to use Dreamweaver for the heavy lifting.

    Yes, I’d like to convert the XML data into other formats in the future as well (print, wireless, fun fun!) and starting in on XSLT sets it up nicely, but today, right now, the XHTML output alone is worth it for me.

  11. I agree that XML/XSLT is far more powerful, but it isn’t simpler to the user…

    we’re all coders, so XML is a walk in the park for us, but the fact is that most clients don’t understand the concept of tags or don’t want to bother understanding because it is a bit complicated…

    so if a client has to choose between XML and REBOL, then he will probably choose REBOL because it looks simpler…

  12. No, I don’t agree with that. It isn’t REBOL which was simple in the article, but the arbitrary markup language the author invented and then was translated with REBOL. The REBOL code is actually more complicated than the corresponding XSLT.

    XML also has a large number of editors available for it. Word now saves to XML, so does OpenOffice. XSLT is a language for writing translators (in this case, translating XML to HTML), so it would, in fact, make it even easier to manage content than the ALA article’s method. Once the designer has written the XSLT stylesheet, the experience is more seamless for the user. They don’t have to memorize any ‘–‘, ‘==’, or ‘##’ codes.

  13. Please explain how this is more effecient/productive/simple than: XML/SQL data storage. Style sheet. Template files. Template files might get replaced with something else as technology progresses, but the data stays in the same simple format.

    As for a client choosing REBOL – I’d hope not. There should be a simple interpreter that spits out the code, XML or REBOL. The client shouldn’t be using time learning a language he doesn’t need. The question is which will get the job done better.

    If anyone has a scenario where REBOL would be superior, I’d be very interested.

  14. the author makes it clear at the beginning of the article, to me anyway, that implementing a CMS with REBOL is not really for advanced developers.

    In the first paragraph Ross-Gill wrote:
    “This system makes it easy for any website operator, regardless of experience, to update site content while keeping markup valid and consistent and ensuring that links stay pertinent.”

    So the REBOL set up may help not so experienced site makers output valid markup as well as helping with organization. That sounds good to me. I think anyone who has studied databases or has a Software Engineering or Computer Science degree can think of a more efficient way to set up a CMS. But believe it or not there are some people out there who need a CMS yet don’t have the know how, are too intimidated for whatever reason, or don’t have time to learn the stuff.

    Surely the article will help some folks who need this stuff.

  15. Please someone correct me but aren’t most of the blog scripts out there (Moveable Type, Radio, Greymatter, Slash, etc.) *already* CMS systems? Perhaps instead of calling them blogs we should call them personal CMS.

    Granted, you have to understand perl or php to modify them to suit different site structures but, they seem, to me at least, to alrady have most of the bases covered.

  16. “the author makes it clear… that implementing a CMS with REBOL is not really for advanced developers”

    XSLT is storage agnostic, meaning it doesn’t care if you’re delivering content from a database or a flat file. Since a large number of simple content management tools have already been developed for it, an adopter of XSLT would find most of the work he’d have done learning and writing equivalent HTML translation rules in REBOL have already been done for him. For example, if you mark up your content in DocBook (an XML dialect, with a number of user friendly WYSIWYG programs that save to it natively), there’s already an XSLT stylesheet for translating it into HTML for you. I think stylesheets for converting Word’s new native XML format are freely available, too, which could be a coup for the developer in the right environment.

    XML was designed to solve the problem of coming up with a new markup language every time one was needed, of any degree of complexity. Now there’s a critical mass of toolkits for it, and the network effect is beginning to mean something important.

    It’s a mistake to assume XML is for advanced uses only.

  17. Maybe using REBOL is great if you have your own server to play with and install the appropriate software, but what about the majority of us who have their sites hosted by a third party?

  18. anonymous poster above, I suggest you re-read the article. The whole idea of the CMS in the article is that you DON’T have to install software on your server – you run the REBOL scripts on your own computer to generate HTML (with templates and so forth) which you then eithe rupload to your hosting account or get the REBOL script to upload it for you.

  19. Chris, what’s this about Word and XML? I poked around in Word as soon as I saw your post and I didn’t see what you’re talking about. I have some pretty non-technical users at my work that are very comfortable with Word and I’m getting pretty good at XSLTs, so this had better not be some kind of cruel joke!

  20. Microsoft claims that Office XP’s native file formats (presumably for all of its components, not just Word) are XML. OpenOffice now claims the same, too.

  21. Actually, looking on their website (see reference below), it looks like Word doesn’t support XML. The only mention of XML is for Excel and Access. Can anyone who is using Office XP confirm or deny this (inquiring minds…)? Thanks in advance.

    http://www.microsoft.com/office/evaluation/indepth/compare.asp

    Summary:

    “XML Support in Excel and Access”
    “Rich support for XML in Office XP enables you to load and save XML directly into Excel and analyze online data by querying XML spreadsheets from the Web. In Access, you can import and export XML schemata, data, and tables automatically using default settings, or you can take advantage of advanced options that provide more control.”

  22. I’ don’t know about office and XML, but I’m shure that the WordPerfect suite comes with XML capabilities…
    I just haven’t checked how extensive those capabilities are

  23. The gibberish produced by ‘save for web’ in MS Word is certainly too strange to be called HTML, but I don’t know that it’s necessarily XML either.

  24. hi all,

    xml really is the native format for all OpenOffice documents.
    but since i’m not an xml expert i don’t know how useful their xml is for further processing. ill provide you with a small example.

    a .sxw (‘Star Office Writer’) file is nothing more than a zip file, containing the following xml documents : content,mainfest,meta,settings,styles.xml

    if you open a simple content.xml that has been formatted with stylesheets, you’ll get :

    […]

    […]

    This is the title


    this is the first paragraph.


    this is the 2nd paragraph.


    […]

    i’d say you can work with this !

    otoh : if you convert a typical MS word document to xml, how useful would the xml be? i’d imagine, if the average user wants a headline he will mark text, press 14pt, then underline, then bold … (same prob with openoffice of course)
    i think you have to educate the ‘content-creating’ people to use proper formatting (prepare some stylesheets for them) to get logically structured documents that result in useful xml output.

    i don’t know about office XP but the html output of Office 2000 is pure junk (Das ist der Zweite absatz).
    couldn’t find XML output in Office 2000.

    btw i can only recommend openoffice/star office 6, i hated staroffice 5 but the latest version is decent. even handling of word files is ok.

    phil

  25. You are missing the point my friends…

    Consider this scenario: a local middle school teacher wants to post his weekly assignments, notes to parents and test schedules on the web. He needs a little more functionality than blogger, but dosent have the loot to pay for a development team to build an entire web application. I have a working knowledge of php, javascript and the like, but I have yet to find a content editing tool that I can implement and understand. Sure I have phpMyAdim installed in my little web directory, but I cant make it do anything! Ive been to devshed, sitepoint and phpbuilder – theyre great sites if youre a developer, but what resources do the rest of us have? the persons who knows html, javascript, etc. but not xml? the developer sites tend to gloss over the real nuts and bolts, while the mid-level amateur such as myself says, ‘there has got to be an easy php, mySql content management system!?’ ya know, the basic. ‘enter-post-edit’ functionality?

    right?

  26. The syntax of REBOL is hardly intuitive, and the constant uploading will be a pain. How about Radio?

  27. I love the relative “plug and play” simplicity of setting up a PHP or CGI based CMS like Moveable Type, Radio, Greymatter, etc.

    Even a web journeyman like myself, more adept at front end niceities than backend mechanisms can, with even my basic and utilitarian knowledge of these lanuages, can set up a blog in a few minutes.

    The problem I have is that I am coveting something that I am not sure exisits, or at least I haven’t found. I want a simple to implement, user frinedly, CMS for the “rest of us” who aren’t looking to “publish” a blog or web zine.

    Most of my sites are your standard “brochure ware” broken down into digestable and informative sections. I have some sections which update more frequently than others with some updating very regularly.

    I’d like to be able to have a CMS system with some basic “author > editor > approval > post live” workflow, but also allow the “client” to be able to update some pages via their browser or via email to certain page templates.

    I guess I want the usability of a Movabletype-esque CMS on multiple pages that has some of the bells and whisltes (like comments and an event calendar) but I want to be able to adminsiter or update (or allow access to let my client administer or update) multiple pages that may have multiple templates.

    Does that make any sense? Anyone else who “has lust in their heart” for such an animal?

  28. I’m sorry, but that just seems like the wrong way to go. As many posters have pointed out already, there are already languages meant for this, namely XHTML (or I suppose you could make you own XML language).

    The only real arguments for it is that “dev guys find XML easy, but others don’t.” But, either way your people have got to learn something, and it wouldn’t be too difficult to learn a bit of XTHML anyhow. Much easier than remembering circle-circle-dot-dot.

    Seems like using a bit of contentEditable with XHTML would easily overpower this solution and takes no time to learn!

  29. ==> I guess I want the usability of a Movabletype-esque CMS on multiple pages that has some of the bells and whisltes (like comments and an event calendar) but I want to be able to adminsiter or update (or allow access to let my client administer or update) multiple pages that may have multiple templates. Does that make any sense? Anyone else who “has lust in their heart” for such an animal? <== I too lusted for such an animal and so built one over the last several months. While it is still in an early stage of development, I am pretty pleased with the results. I created a rich IE-based client for assembling sites from templates and assets. Pages can have three levels of templates and each template level can have referenced page elements. I think that I am close to acheiving the separation of content and presentation which many webmasters seek! The server-side is XML/XSLT/SOAP/WebDAV. Pages can be previewed in the editor and published to any WebDAV/FrontPage compatible server. Anyone who kn

  30. This is from The Screen Savers at TechTV. It’s an interesting little tool.

    “You know how annoying it can be when, in the middle of typing a document, suddenly a paragraph’s formatting changes. Argh! I didn’t want to do that! How can I stop this from happening? Look no further than the built-in script editor. Open it by pressing Alt + Shift + F11 on your keyboard. Newer Word documents are done in XML, so you can easily edit the source to your heart’s content.”

  31. If anyone is interested there is a basic XML content editor on Source Forge.

    The idea is to provide simple content management for xml web sites. At the moment it’s a very simple text editor using php and javascript (CSS front end) but the goal was to make it wysiwyg (based on the XSL templates being used to parse the XML).

    It’s simple to set up and reasonably simple to use (tho the wysiwyg version would remove tjhose XMl tags)

    It’s at: http://zypexce.sourceforge.net/

    Later
    Josh

  32. i have a CGI CMS that simply edits txt files, then the said files are called into the page where needed.

    it does its job, and allows the site to be maintained from anywhere and by anyone.

    its nice and simple, and the user can insert html tags (bold, italic and hyperlinks) very easily.

    is there a better way to do this? i know php is faster, but im more familier with cgi.

  33. I seem to be a rare case here, but I loved Chris’s article. Maybe it’s because I’m closer to his target audience–and Rebol’s target audience–than others here.

    First off, for me, Rebol is a great discovery. Although I’m tech-orriented enough to run a linux system at home, I’ve never had much luck learning any program/scripting languages–it simply requires too much time. As a writer I’m mainly interested in using technology to get the job done. Since discovering Rebol through this article a few days ago, I’ve quickly learned how to make useful scripts for my own computer system.

    And I’m looking forward to getting this content management system up and running. Sure I use Moveable Type for my blog, but there are also non-blog pages I’d like to put on my site. This Rebol-based CMS allows me to do this on my own computer without the overhead of a database and without the time overhead of learning to hack Perl to modify MT.

    Though I’m behind open source software, I’m also behind ease of use. Thanks Chris!

  34. This is the first I’ve heard of REBOL. REBOL is a solution to the classical problem of separating page layout/design from content. If I understand correctly, REBOL handles this entirely on the client side, providing simplicity and server independence.

    The design goals of REBOL are similar to the design goals of Webegnz (www.webgenz.com) and other HTML preprocessors. The basic idea is to define a collection of reusable templates and content macros. Then, a “generation” process merges the templates and the macros to produce HTML files. In the case of Webgenz, there is a full set of graphical tools to support managing these templates and content macro files.

    In comparison to XML and XSLT, I prefer the approach described in the paragraph above. Although XSLT is an interesting and useful technology, it is not a silver bullet for solving the complexities of managing and maintaining complex web sites.

    What would make managing complex sites more efficient? How about a “website object model” which allows sites to be built from plug-and-play modules with defined interfaces. Certainly this technique has served the software industry well over the past 20 years. Now we need to explore ways to apply it to the problem of managing web site front-end code. What do you think?

    -Dave

  35. I’d have to agree, XSLT is the way to go and the use of REBOL is mildly obscure and confusing.

    There are a variety of command line tools that let you batch XML -> stylesheet -> file. Even for the scenario outlined in the article, the use of xsl templates would maximize reusability later down the road.

    And calling this a “content management system” is a bit of a misnomer as CMS’s involve work flow processes, hence the “management”.

    And as for the comments on SQL Server’s XML support being “incomplete”, eh? How is it “incomplete” exactly?

    Finally, for the mod_rewrite on IIS, there are a couple for IIS, however asp.net has built in support for a similar scheme that is quite delicious.

    Anyone else’s eyes hurt with this color scheme?

  36. The mini-language is similar to the way wiki systems work. I implemented something like this for our company’s sites, originally as part of a wiki, but later as a mini-CMS just like the article describes – it may be of interest to the “you should have used XML” crowd.

    My target was to produce a JSP custom tag which could be used to reformat its content on any page. I envisaged the managed content being fragments (like the text in this forum). Since we expected end-users to be using the system, the mini-styling language used many of the conventions of MS Word’s smart typing (eg _italic_, *bold*).

    I implemented the parser for my mini-language as a SAX2 XMLReader, faking up SAX events for the structures I parsed. This meant I could plug the output directly into an XSL processor. Calling SAX2 ContentHandler methods like this means you dont ever have to escape out special chars from XML; you’re acting as if you’ve already gone through the XML parse stage where the entities are decoded.

    The custom tag (a few lines of code) simply allowed me to set an XSL stylesheet, which it plugs into the parser. On the plus side, this is all quite standards compliant and we can do nifty stuff like dump content as PDF (using XSL:FO). On the minus side, implementing the parse rules in Java was not nearly as flexible or easy to understand as the system described in the article. Does the job tho.

  37. I’ll reiterate that my solution is client-side. You download Rebol to your client’s machine. Blindingly easier than setting up Perl. Download REBOL/View and you can add your own GUI – CMS at a button press. Easy.

    XML/XHTML – This is an XHTML solution. Rebol is what you make of it and I find it an easy way to produce valid XHTML. The document format I created (well, modified) is not Rebol syntax – you could parse it with Perl or any language, but it’s purposely visual so it’s easy to learn. Side note: Rebol is not common in hosting packages, but if you used it for CGI, you wouldn’t turn back. Demand the best.

    In many cases Rebol works well with XML. In many cases, a Rebol solution is better than an XML counterpart. In many cases, XML would be the way to go. The great thing about open standards is you can approach them with whatever tool suits you. Use your imagination (Rebol’s middle name is Expressive, kindof).

  38. I have seen Rebol mature over the past 5 years, and have been impressed how it has grown features, graphics without much size increase.

    I think a few people “got” the elegance of the markup languages that have been done in Rebol. It is nice to have the Open System mentality in a commercial product. You can see the elegance of the markup language, and the source to the parser, which is tiny enough for anyone to read.

    I like that I can author documents in a markup language with code built-in that can execute to create diagrams, and is of higher elegance than K&R’s pic language. Open Systems never has had it so good before.

    O’Reilly said that Perl was the Duct Tape of the Internet. Perl has done a great job, as well as other home-brewed languages, but it is nice to have Rebol, which is a finely machined tool, OS, and GUI for the Internet.

    For a vintage article, which helped me write a GPSbot.r a couple years ago, try this out, and you will see some more of the power under the hood:

    http://www.newarchitectmag.com/archives/1999/09/junk/

    I have been amazed the the beautiful Web spaces that Chris has created with his art + scripting ability.

    -Steve Shireman, wireless CTO, Technical Futurist, and 25-year Unix Tool Sharpener

  39. I’m the author of one of the sites mentioned at the end of the article. Just came across this article today.

    One of the advantages of storing content in plain text like my eText format, is that the plain text can be show in an html textarea element and used to make a Wiki. For my own site, I use a browser and wiki to make changes to my local content, then upload the generated .html (and .txt) to my site. I’ve done this so that non-technical people can see how the formatting works and intuitively understand it, just based on normal typewriter usage, not just computer plain text.

    The other advantage is that plain text is a ideal storage medium. As I write better and better eText parsers in Rebol, I can glean additional information out of the written text and generate better HTML and XHTML code.

    If stored as XML, as an author I’d have to have complete understanding of what I’ve written to be sure that I’ve encoded my information correctly. Encoded as XML, it would be harder for non-technical people to understand, and, if altered, by non-technical people, either directly in a plain text editor or through a browser and Wiki combination, it’s more likely to be wrong (those leading and trailing angle brackets, and tags).

    With plain text, it’s immediately obvious to a nontechnical person how the text is laid out, and how to enter new headings, paragraphs, lists, and so on. They simply type and layout text in a text editor or browser/wiki text area, as they would normally for a piece of paper and type writer. The software then formats the text appropriately.

  40. Having a neat little mechanisim that splits up markup, links and content is nice and nifty – using a proprietary mechanisim is shooting sparows with canons.
    Appropriately applied CSS, JavaScript, and classic HTML with some Frames should do the trick nearly just as well and speed up content provision a great deal. After all, copying and pasting a JavaScript array or a text only .html doc isn’t all that more difficult than designing and using your own ML, no?

  41. Rebol/Core, an executible which which weighs in at less than 260k _total_, runs on 42 platforms, provides true 100% portability, resolves the LF/CR problems between platforms, has NNTP, SMTP, POP, HTTP, etc protocols built-in datatypes, money, time, tuples, urls, parsing with alternation, full reflection, is its own metalanguage, is free, natural language, key-word free, well, it is true, you cannot shoot sparrows with it.

    But you can change the nature of computing with it…the platforms have been brought up to the same level.

    I’ve thrown my perl to the swine, I thought Java and Java Script were cool in the mid 90’s, but they didn’t deliver what I needed for speed, size, and expressiveness, especially for embedded world.

    Can anyone else do CMS in an embedded device or cell phone? Not sure, but haven’t heard of it yet.

    Am I on drugs, you ask? Nah, just Rebol….

    …why wait 20 years for everyone else?

  42. Hello,

    I know PHP, JSP, ASP, XML, JAVA etc… and I also know Rebol, and what you don’t seem to understand is that this article is from users point of view and not programer’s point of view and sure a user DON’T WANT TO CODE XML or HTML do you forget that ?

  43. I found this :

    http://www.frozen-north-linuxonline.com/code_corner/code-corner_Oct.html

    I found the ‘ML dialect difficult to get used to, being so used to my object approach
    which I inherited from C++ programming. Having said that, I am in the process of replacing
    and recoding the ‘ML dialect in my Rebol projects. The learning and recoding curve is
    worth it for improved quality control, and also the method enlists the rebol interpreter
    in the error-checking process.

    As Rebol matures and adds assets, it is my hope that custom dialects become part of
    what this highly efficient scripting language offers to programmers.

  44. Am I being thick? I have just tried out the REBOL CMS described in the article ‘Simple Content Management’. I assume one has to rename the file from content-management-r.txt to content-management.r. Unfortunately I get the following error message:

    ** Access Error: Cannot open /C/My Documents/REBOL CMS experiment/template.html
    ** Where: punch-template
    ** Near: template: read %template.html
    replace template
    >>
    Can anyone tell me what I have done wrong? This is very disappointing. The directory pages is created, though.

  45. Hi Chris,

    I would like to know, once the system has been set up,
    how other users (who may be around the world) can use it.
    Do they have to download rebol or do they just use the browser?
    Can they post pictures and sounds (files) ?
    My housemate Martin wants a content management system that does this. He has been travelling around, and has some friends all over the place. He wants a unified place where they can share stories, pictures etc.
    Is this what this is for?

    Regards,

    Anton.

  46. The idea of my clients having to learn any kind of syntax (be it simple as it may) doesn’t really convince me;
    technically I find rebol quite compelling though,
    but that’s not the issue..

    Marek

Got something to say?

We have turned off comments, but you can see what folks had to say before we did so.

More from ALA

I am a creative.

A List Apart founder and web design OG Zeldman ponders the moments of inspiration, the hours of plodding, and the ultimate mystery at the heart of a creative career.
Career