wfsp has asked for the wisdom of the Perl Monks concerning the following question:

I'm in the final stages of 'deframing' a web site. I have a 'demo' up and running and am waiting for the site owners to give the go ahead. At the moment their comments are about the font sizes and colours (sigh!).

I'm convinced that frames are a bad idea but loosing them is a case of two steps forward and one step back. Each page now contains a top banner, navigation side bars, common footer etc. with the obvious difficulties that arise if you need to make any changes to these elements.

I've made a tentative first step. The site has extensive site maps (lists of links in chronological/alphabetical order - not unlike a 'Newest Nodes' type of arrangement). They are currently generated locally and FTPed to the web server. On the demo site these have been successfully loaded into a MySQL db and served up as required.

So far so good. What about serving up the whole site in such a manner?

One question is where to keep the content (articles) - in the db or as HTML files without the common elements? And jpegs/gifs? I'm leaning towards files. While the bulk of the aricles are straightforward there are many that, for example, include tables so the easiest way around that would be to have simplified, but valid, HTML files with the bare minimum of content.

A further constraint is that the owners (correctly) want to be able to post material themselves in as simple and straightforward a manner as possible (that means, sadly, MS FrontPage).

update:
They use MS FP to prepare the HTML. They don't use any FP extentions/jiggery pokery or use it to FTP the pages. They are never short of font/span tags though :-)

I envisage a setup where the CGI script would add all the necessary elements to each cut down page before serving it up. There would be an 'admin' script/form that would allow the files to be loaded on to the server, add a link to the home page and make necessary updates to the db e.g. file name, date, language, subject, category etc.. This would also mean the owners could update the website when they are away from the office (e.g. from home).

We could also avoid some <cough> synchronisation hicups between my local copy of the site and theirs, "you've overwritten my article!". I hadn't, but the link had disappeared from the home page :-)

The existing db would not need much work done on it. A further aim is to have 'breadcrumb' links at the top of each page which, in my opinion, is not feasable at the moment.

There would only be three 'updaters', four at the most. We have SSL.

Has anyone had experience with this sort of migration/process? I'd appreciate any comments/advice any monks may have.

Modules currently used:

(general)

(site maps) (keyword search) (send to a friend) (printer friendly)
  • Comment on OT: Migrating towards a Perl/MySQL/CGI website

Replies are listed 'Best First'.
Re: OT: Migrating towards a Perl/MySQL/CGI website
by bradcathey (Prior) on Dec 28, 2005 at 13:43 UTC
    I'm convinced that frames are a bad idea but loosing them is a case of two steps forward and one step back. Each page now contains a top banner, navigation side bars, common footer etc. with the obvious difficulties that arise if you need to make any changes to these elements.

    Frames *are* a bad idea. "Deprecated" as we like to say around here. Why don't you consider HTML::Template's INCLUDEs. I use them for the header and nav bars, and then for address footers. The nice thing is that they can contain <tmpl_var >'s that get values from your Perl first.

    Have you looked at CGI::Application? I heard a lot about it around the Monastery, and finally couldn't stand the guilt. The learning curve was about a week, but I'm a convert now. I recommend you look hard and long at it.

    One question is where to keep the content (articles) - in the db or as HTML files without the common elements? And jpegs/gifs? I'm leaning towards files.

    I keep all my plaintext content in the database and serve it up in <tmpl_var >'s. All my images and uploaded PDFs, etc., go in directories in the public area. I have discovered that the general wisdom is not to store images in the DB.

    I envisage a setup where the CGI script would add all the necessary elements to each cut down page before serving it up.

    Are talking about some type of content manager? That's what we have done. If you are storing the content in the DB I don't think the loathsome FrontPage will help (another way to update static content is with Macromedia's Contribute).

    Good luck.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re: OT: Migrating towards a Perl/MySQL/CGI website
by leocharre (Priest) on Dec 28, 2005 at 15:35 UTC

    Oh boy. Yes, this is my previous line of work- and I loved it.

    What I ended up doin was having a wysiwyggish interface like mini mce and tied it to a backend- and let users create stuff..

    This is a last site that I made with a lot of what you're talking about Dolan Geiman- this is an artist's website- they need to put new news up like mad, and articles, and press, and this and that etc etc etc. Check out the press section. I haven't needed to do much work on this aftwards.

    Make sure you GIVE power and RESPONSIBILITY to the client for content- otherwise you will be in hell, my friend. I advice against letting them upload actual html like i advise against chewing on razorblades as a sleeping aid.

    I've got experience with that too.. on this site: gootees.com - but.. all of this other stuff : http://gootees.com/used.html is done via flat files.

    If you like the dolan geiman site i'll send you the code. the interface is neat. all of it is on css. the site and backend are sepparattish.. you may be able to use some of it.

Re: OT: Migrating towards a Perl/MySQL/CGI website
by thedoe (Monk) on Dec 28, 2005 at 21:22 UTC

    In regards to allowing the owners to post their own material, FrontPage is not the only way to go.

    One of the best resources I have found when creating a system like this is the HTMLArea, from dynarch. It is free and VERY simple for users to understand.

    This allows them to create the HTML they want, which is then submitted to your cgi like any other form input. You can then do whatever you want with it. For example, in your case, output the data to a flat file or store it in your DB and then include it as part of your template.

    And yes, this means I would also agree with the others in regards to setting up your site using something like HTML::Template, as you already seem to be started on, to structure the site you are working with. It makes site wide updates much easier on you by allowing you to break things down into an MVC (model-view-control) structure.

    Good luck!

Re: OT: Migrating towards a Perl/MySQL/CGI website
by TedPride (Priest) on Dec 28, 2005 at 21:02 UTC
    As I see it, your problem is including the header, footer, menus, etc. in the site. Unlike the main content, these are unlikely to change, and when they do, will change across all the pages that use them instead of page by page. Therefore, all you need is something that merges the different parts, rather than interpreting them as well. Take a look at Server Side Include. SSI is capable of doing a limited selection of dynamic content, like printing date / time, and for anything more complicated (your content), you can include a Perl script - or a file generated by a Perl script (best choice if the content is viewed many times for every edit).
Re: OT: Migrating towards a Perl/MySQL/CGI website
by srdst13 (Pilgrim) on Dec 29, 2005 at 13:58 UTC

    I would certainly take a close look at using Template Toolkit as your template engine. It enables (encourages) the use of modular templates. So, you can have a "sidebar" template, a "navbar" template, and a "body" template; the first two would be "included" on every page while the third would vary based on what content you were serving.

    Capitalizing on the template engine allows you to make changes to the presentation (even drastic changes) without changing any underlying data. Storing HTML as your "content" has a significant downside. If you ever want to change the content, which the client is probably making available as something other than HTML, you have to regenerate the content that goes to the site. With a templating solution, the content is stored in a raw form and just plugged into the template appropriately.

    I would also agree with the first poster that CGI::Application is a good stepping-off point for developing such a site. I would add that I have found Catalyst useful in this regard as well. The two accomplish the same task, but take very different approaches. There are other web frameworks out there, as well.


    Sean