Meritorious Monks, You ever get the impression that something that should be reasonable is simply impossible within the existing web framework?

Here's what I want right now for a web site I'm re-doing for a client:

  1. A single content page template that non-programmers can dump content into in a wysiwyg editor on their local machine and be instantly web-publishable
  2. a central style definition that is applied to all content pages
  3. normal http serving, not dynamically generated pages
  4. centralized page layout html (à-la SSI)

A deceptively simple sounding list of desires.

Yes, I can serve static html pages by pre-merging the templates with the content, but this introduces a separate generation step that authors either have to take care of themselves, or has to be programmed as a cron job and authors have to wait until the job runs to see their changes.

Yes, I can have the page layout html served by Server Side Includes, but then the authors can't see the page layout locally on their machines while their adding content.

Perhaps the solution is an online web page editor. Something that runs on the server, so that pages are displayed with their Includes and their CSS intact even during editing. To solve the template/generation problem, it would be able to extract the content from existing pre-generated pages and apply it to a new template when the template is updated. And it would of course be Perl-based so I can fiddle with it.

But IS there such a monster?

Or something else?

Or am I unreasonable?




Forget that fear of gravity,
Get a little savagery in your life.
  • Comment on Failings of web languages to address reasonable demands

Replies are listed 'Best First'.
Re: Failings of web languages to address reasonable demands
by jdtoronto (Prior) on Aug 31, 2006 at 20:35 UTC
    punch_card_don,

    Writing a small content generation system isn't difficult. Think about this, have a page template written for HTML::Template, write some object modules that each instantiate an editor block, one for text, one for uploading images. In the template make the variable names parsable, for example: <TMPL_VAR img_1_150_180> which would instantiate an image uploading obejct that checks to make sure the image, number 1, is 150 x 180 pixels.

    Then using a javascript onSubmit event on a preview button, invoke code to preview the page in a separate window. When the user is happy with the page invoke, some code that saves the page as an HTML document.

    To be honest it ain't rocket science. I wrote such a thing a couple fo weeks ago for a travel compant that his a monstrous Websphere/Java site. They need to change some advertising pages very quickly and they have no time to go to designers or whatever. So using a selection of templates I have given them and a couple of thousand lines of CGI::Application code they can generate a new 'landing page' in about 5 minutes and using a 'back-door' they can deploy it on the production server.

    In fact, using this technology we handle dynamically generated Flash objects or two types, landing pages for ads and special offer and email templates for a truly weird Java based email customiser and sender. We also included a URL wizard function so they can select the basic features on a page and, for example, create the necessary href with Javascript to open pop-up windows, create Iframes within a page or link to documents requiring access through a Java action on the main server.

    Perl truly is the duct tape of the internet because my crew did this in about 60 hours and the client is happier than a porcine in mud.

    jdtoronto

Re: Failings of web languages to address reasonable demands
by perrin (Chancellor) on Aug 31, 2006 at 20:17 UTC
    The CMS suggestions given to you earlier do just what you're asking for here. They also do a lot more, which is why I suggested you look at simpler things like Bloxsom.

    A common way to address the issue of previewing dynamic content with SSI and the like is to set up a preview server where people do their work, maybe with a Samba mount so they can just drag files onto it and see them through a browser.

Re: Failings of web languages to address reasonable demands
by samizdat (Vicar) on Sep 01, 2006 at 13:12 UTC
    You might look at TinyMCE for your WYSIWYG editor... we use it to generate web Zines on the fly.

    Don Wilde
    "There's more than one level to any answer."
Re: Failings of web languages to address reasonable demands
by jhourcle (Prior) on Sep 01, 2006 at 14:01 UTC
    1. A single content page template that non-programmers can dump content into in a wysiwyg editor on their local machine and be instantly web-publishable
    2. a central style definition that is applied to all content pages
    3. normal http serving, not dynamically generated pages
    4. centralized page layout html (à-la SSI)

Does SSI qualify as dynamically generated pages?

If it does, you can use Frontier, or something similar, and do the pages, then have the system render all of the pages, and publish them. BBEdit and a few other text editors have templating systems that can handle this sort of work, as well.

If you're willing to let the server do some extra work, you can set an Apache Handler to wrap the pages in a header and footer, or use mod_publisher. Netscape/iPlanet/SunOne have options to automatically insert a footer for all pages in a given directory, and I think you can do headers, but it's been a few years.

(The thing to remember is -- they'd be editing the base content of the pages ... this keeps them from trying to mess w/ something out of scope, and they learn to realize that content and layout are seperate (which they are, as you can easily change the header or footer down the road, and if they make desicions based on layout, it might cause problems later)

...

Personally, depending on how much I have to do, I just make a generic template, with a SSI in the middle that calls an include based on $PATH_INFO. (the only problem is, you can't set the title dynamically except based on $PATH_INFO)