Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Changing every page at once...

by elise (Initiate)
on Jan 09, 2002 at 22:47 UTC ( #137517=perlquestion: print w/replies, xml ) Need Help??

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

I have a web site with tons of pages... More than 1000. I really don't want to have to change the look of every page one by one. Is there a script that would allow me to change the look of every page at once and place the content where I want it? (It would be in the same table in every page.)

~ Elise

Replies are listed 'Best First'.
Re: Changing every page...aka How not to design a site.
by BazB (Priest) on Jan 09, 2002 at 23:06 UTC

    You _really_ want to give a lot more information than this, but I'd guess you want Cascading Style Sheets, which allow you to control the look and layout of your pages - nothing at all to do with Perl.

    If this isn't the case then Fletch has already suggested another answer.

    I'm guessing wildly as it is.

    1000 pages. Ick.
    Delete everything, start typing really quickly.

Re: Chhanging every page at once...
by Fletch (Bishop) on Jan 09, 2002 at 22:51 UTC
    You want to look at one of the templating mechanisms such as Template, HTML::Mason, or any of the bazillion others. Those will let you define content seperate from the presentation chunks and switch things around easily.
Re: Chhanging every page at once...
by gav^ (Curate) on Jan 09, 2002 at 23:44 UTC
    I've done this recently for a large site. Basically they wanted to get rid of all the horrid things like font tags, a lot of tables, and generally tidy it up before applying CSS.

    Using HTML Tidy (a fantastic tool), is a great start. Then I used HTML::TreeBuilder (my prefered HTML parser) to fix up a few more things.

    Then I'd recommend stripping out the body of the document, then adding some sort of template for the top and the bottom. Then you can easily change the whole look of the site. Template-Toolkit or HTML::Template are both nice systems.

Re: Changing every page at once...
by FoxtrotUniform (Prior) on Jan 09, 2002 at 23:11 UTC

    Such a script should be fairly straightforward to write, though I doubt it'll be much fun. Have a look at File::Find and the LWP modules.

    If your content is fairly well-defined, though, your time might be better spent extracting the content and munging it for use with a templating system, like HTML::Template or Text::Template. has an excellent article on templating systems that you might find useful.

Re: Chhanging every page at once...
by Aristotle (Chancellor) on Jan 09, 2002 at 23:56 UTC
    If you want to generate the pages offline, not dynamically, I suggest that you take a look at the Website Meta Language. It isn't a Perl script, but it offers accessibility via Perl and does just what you want.
Re: Chhanging every page at once...
by kwoff (Friar) on Jan 09, 2002 at 23:36 UTC
    The script exists in the sense that a sculpture exists already in a block of marble.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://137517]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2022-06-25 22:23 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (83 votes). Check out past polls.