Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I not sure whether you mean:

• you want to store the content, and not the HTML in this database, or...
• you want to store both in the database

In either case (thought not so sure you'd want to try the latter), what you are proposing is nothing new. In fact, unless I'm not reading correctly between the lines, you are talking about a database-driven content management system (to make it sound important). This is the underlying structure for more and more Web sites, and is the future.

Before joining the order of Perl Monks, I used to store all content in flat files, and HTML in the Perl scripts that would pull the content from the files and then render the HTML pages as "here documents."

Well, those days are gloriously over. Thanks to HTML::Template and MySQL. The latter makes content storage and retrieval nice and tidy, and HTML::Template allows you to build and maintain standalone HTML pages with placeholders for the content to come later. Perl scripts pull content from the database and H::T renders the HTML page with the content inserted.

Of course, you will need to supply a GUI for your users (can be done through something as simple as HTML forms or as complicated as the Microsoft DHTML Editing Component).

I hope I got what you were asking, it's just that the practice is so common today that I thought I might have missed the point of your question. Apologies if I did, and write on if I didn't.

—Brad
"A little yeast leavens the whole dough."

In reply to Re: pulling content from db - is it a good idea? by bradcathey
in thread pulling content from db - is it a good idea? by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (9)
As of 2024-04-18 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found