in reply to pulling content from db - is it a good idea?

I would suggest not to store the HTML contents in a database. It just makes it inconvenient to view and edit the pages.

I would rather make a distinction between logic data and physical layout. Build a two layer system:
  • A logical data layer that represents the data to be shown;
  • A physical presentation layer that builds the webpage;
    and separate the two layers as much as possible.

    For example, I would classify the member's information as logical data, and store them in database table(s). I would use modules like CGI, HTML::Template, etc to build the look & feel of the webpage - the physical layer.

    +-----------------+ | HTML TEMPLATE | presentation layer | | +-----------------+ | | HTML::Template +-------------+ | PERL SCRIPT |---------> build the final HTML page +-------------+ CGI | DBI, DBD | +-----------------+ | MEMBER's INFO | logical data layer +-----------------+ | DATABASE | +-----------------+
  • Replies are listed 'Best First'.
    Re: Re: pulling content from db - is it a good idea?
    by Taulmarill (Deacon) on Nov 25, 2003 at 11:59 UTC
      hm, HTML::Template seems to be real popular here.
      did someone ever use Template Toolkit? it seems to me, that itīs mutch more purefull and versatile.
        Well, I mentioned HTML::Template just as an example, not to force the use of it. You can use any toolkit you like to build the HTML pages of course. I did say 'etc', didn't I?

        %^p

          my post was no criticism but just a question.
          every time it comes to dynamic HTML, all posts refere to HTML::Template but no one to Template Toolkit. so i was wondering if there is something wrong with this module or the monks here are just used to HTML::Template since itīs the older module (i think).
          Template Toolkit (aka TT2) is mutch more versatile (i think), so iīd like to see some opinions on this from other monks here.
    Re: Re: pulling content from db - is it a good idea?
    by kiat (Vicar) on Nov 25, 2003 at 12:30 UTC
      Thanks, Roger! I'll keep your proposal in mind :)

      One of my considerations is to make it easy to pull out the data for modifications by authorised persons.

      I was also thinking that if I had everything in a database, it might make managing every piece of data in the site easier to manage.