PDA

View Full Version : Html mass change



Elvyne963
September 19th, 2008, 03:07 PM
Hi, I'm currently working on a site that has many pages, and all those page have the same exact menu placed at the same position, and right now I'd like to change something in the menu, but the only thing I can think of to do this is go and change what a want in the menu one page at a time. I presume there must be another to do this, even if it means changing what already in place please tell me :)

Thx in advance

Ps : here my site for reference if you want www.skillsthatimpress.com

Templarian
September 19th, 2008, 04:55 PM
That site has like 5 pages, but anyway just do a simple regex replace on all your project. Any typical editor will work.

Find:

<div id="ZoneBouton">(.*?)<\/div>
Replace (new nav):

<div id="ZoneBouton">
<p align="left" class="style2"><a href="bio.html">Bio</a><br />
<a href="photos.html">Photos</a><br />
<a href="videos.html">Videos</a><br />
<a href="spectacles.html">Spectacles</a><br />
<a href="contact.html">Contact</a><br />

<a href="cour.html">Cours</a></p>
</div>

jezuz
September 19th, 2008, 08:14 PM
i likes to use php includes, as in copy exactly wat the repeating part of the code is... paste it into a blank php file... completely blank, no header or anyhting...

then make a include exactly where u took out the code from ure original page... if u need help on includes, look it up on google

Elvyne963
September 20th, 2008, 10:02 AM
For the "It has only like 5 pages", I think you didn't see in the gallery section, it links to other pages, and right now I got like 16 pages or so, and I will get more soon. (probably I'm not doing the gallery as effecient as it should be).

Thx for the php solution !

senocular
September 20th, 2008, 10:07 AM
That site has like 5 pages...

Think about getting punched once. Then think about getting punched 5 TIMES!

Thought so!


;)

senocular
September 20th, 2008, 10:09 AM
For the "It has only like 5 pages", well it's because you didn't go in the gallery section, which then give other links to other page, and right now I got like 16 pages or so, and I will get alot more soon, that's why I ask help for mass change. And, exept if I missunderstood, right now your telling me to simply go and change each page one by one ?

How are you writing your HTML, as in what editor are you using?

Any decent editor, especially HTML editors, will have a search and replace that works for multiple pages. You can use that to search for what you need to replace, and easily run the replace function once, but have it affect all pages.

Elvyne963
September 20th, 2008, 12:28 PM
I'm using Dreamweaver CS3, and thx for the suggestion I hadn't thought about it at all...Omg, that will save so much time !!

Thank you again :D

Ps : Sorry Templarian I had not understood that you were pointing me to use automatic find and replace, I thought you suggested I do it one by one manually.

Templarian
September 20th, 2008, 12:32 PM
^I would suggest learning some simple PHP as jezuz suggested, it will save you a ton of time on things like this (then you can move on to just using a CMS/custom solution).

Or just learn some more basic regex.

Think about getting punched once. Then think about getting punched 5 TIMES!

Thought so!


;)
... so he got punched 16 times.

At work its worse I have to once and a while edit really old sites with 100 pages changing the navigation/links, regex is the only thing that keeps me sane. (our new sites that I work on/make use wordpress :))

//edit, @ your edit, sorry I didn't make it more obvious yes your search and replace allows the use of regex, makes life so much easier as long as you know regex.