Forum Moderators: skibum

Message Too Old, No Replies

How do you all do it?

For those with sites with MANY pages

         

jaames

8:36 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



I have over 200 php pages, and now I need to just add/replace a simple wordings in the content (not header or footer, but the content), does this mean I have to do 200 pages manually? That will take me forever. It just a simple word change/replacement in the content.

I was told Dreamweaver does the trick, could someone care to explain? I don’t know where to start.

or if anyone else have any ideas on what tools/codes to use so I can do this modifcation without going through 200 text file pages?

Also, For example, if I wanted to play around with the position of my ads in the content page, going through 200 pages is a nightmare.

I think this is not a Php issue, is more of using a tool (possible dreamweaver) that would help me play around with the content of all my pages at once, such as adding a word or simle code or table.

Thanks for yoru help.

s2kinteg916

9:15 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



what alot of people do is they make a header and footer template file and use phpinclude. Each of the pages uses the same header and footer so each time u make a mod it will take care of it for all 200 pages.

As far as ads in the articles or content itself u have to build a template system to achieve what your looking for.

jaames

9:59 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



But what if i want to make changes to the content itself. for example, if my content are layed out in bullet points, but i want to change it to a different bullet point style.

That has nothing to do with the header or footer. Its got to do with the middle (content) aspect.

[edited by: jaames at 10:01 pm (utc) on Sep. 21, 2005]

petermax

10:01 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



You can search and replace words in a general text editor. TextPad will open any number of files as a list and do the operation in one go.

The common stylesheet linked to each page handles the appearance of elements including their positioning.

And as already mentioned use php includes for any repeating sections like headers and footers.

jaames

10:21 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



Thanks peter, i know what you mean. But i would still have to do that "find and replace" page by page don't i?

I was wondering if there was a tool that i can find and replace for all the 200 pages.

King of Bling

10:30 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



Your CSS file perhaps?

Nefig

10:42 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



Dreamweaver is a great tool for that.

You find the code you want to change and then choose a folder in which you need this code replaced with something else, or open only few selected files from the folder and change it only in the open files.

I use it all the time, it supports regular expressions, you can also find particular tag, let's say, <td> which has an attribute class=header and replace it throughout the site with, for example, <td class=somethingelse height="30" align=center> and so on...

And yes, it changes all files at once, you don't have to go manually through all of them.

Hope this helps.

ronin

11:19 pm on Sep 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I was wondering if there was a tool that i can find and replace for all the 200 pages.

I use Notetab rather than DW, but it makes quick work of a global search and replace.

I'm not very good at WYSIWYG and much prefer using a versatile text editor. The free version of Notetab is probably not the best text editor in the universe, but I'm very comfortable with it.

jaames

12:15 am on Sep 22, 2005 (gmt 0)

10+ Year Member



Hey Nefig,

Thats what i was looking for but i have no idea what to do.

I have dreamweaver, can you explain how i go on about changing multiple files?

perhaps a breif step by step

Thanks

buksida

7:23 am on Sep 22, 2005 (gmt 0)

10+ Year Member



As mentioned above I use Dreamweaver to do it also.

Open any one of the files you want to change, select and copy the text or code you want to change, press ctrl+f to bring up the find and replace box. Put the original code in the top, then the new replacement code below it. Then at the top you can select where/what you want to replace ie. in one file, all files in one folder, entire local site etc. Click replace all and watch the magic!

FourDegreez

7:41 pm on Sep 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What I've done is created a script that breaks my content into pieces--paragraphs, mostly--and stores them in the database. Each piece is stored as a record in a mysql table along with what html tag to wrap it in. Again, mostly p's but some hX's as well, and possibly other stuff (haven't gotten there yet). I use mod_rewrite to redirect all URLs to content to a single PHP script which gets the content out of the database and displays it -- and I can change not just the header and footer universally, but also make a change that says "float this ad to the left after the 5th paragraph of content." Or "change all h2's to h3's" (via a simple SQL update). It works out pretty good for me.

ibiza

6:30 am on Sep 23, 2005 (gmt 0)

10+ Year Member



Jaames, I'm sorry to hear about the situation you are in.

I just wanted to let you know, most PHP developers never run into this problem once they've been coding for a while. In fact, it's probably the first problem that they deal with.

You might want to look into a templating system. I have a site with over 2000 "pages". I have about 5 files that run about 95% of the site. And other 10 files that do the rest.

It's extremely easy to update your site if you are using a database backend, a template system, and correct XHTML and CSS.

whitenoise

8:49 am on Sep 23, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



You can use Dreamweaver's find and replace. From the "find in" select either your entire local site or a folder where you want to make the replacements. Choose Source Code from the 'search' box. Now simply enter the text you want to find in the 'find' box and the text your want to replace with the 'replace' box. Tick the boxes that apply , ie if you want to match case for example.

Click Find Next first and see what it finds. If this is correct hit replace. Now go back and see what it has replaced just to make sure this is correct. If everything looks ok, try a few more like this, and if you are happy then you can go for the big one. Open the find and replace again and this time choose replace all. You probably get a warning, but if you are happy go ahead.

This is the way I used to change thousands of pages at once - very simple and a GREAT time saver! Imagine changing each file by hand?! Make sure when you do this though that you include enough around the find text to make it unique to what you are finding. I have now moved to Mysql, templated system and it works sooo much better =)

Hope this helps.

1Lit

11:07 am on Sep 23, 2005 (gmt 0)

10+ Year Member



I use this [gossamer-threads.com] free script. You need to install it on your servers. It has a search and replace feature as well as all kinds of other editing facilities.