Forum Moderators: open

Message Too Old, No Replies

utility to change html page titles

         

glyphomat

9:55 am on Jan 18, 2005 (gmt 0)

10+ Year Member



anyone know a quick way to change html titles?

I'd like to change the title to match the file name - simple if it was a php driven site but it's a manual build

what I *really* want to do is take the existing title (all the files have the same html title) and append the filename

does DW have anything like this?

also I'm still looking for a utility to add quotes to: width=99
but without touching any of the other formatting?

limbo

10:08 am on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use site wide find and replace

Find: <title> Old title </title>
Replace with: <title> New title </title>

Find: width=99
Replace with: width="99"

You might want to consider renaming each page to better convey the content - SE's like <titles>! ;)

glyphomat

10:28 am on Jan 18, 2005 (gmt 0)

10+ Year Member



Limbo - that's not going to be any use

as I said all titles are the same so sitewide f&c will change them all to something else - it cant append the file name as I need

as for width=99 I'm looking for a generic replacement -there's a large number of width=x, height=y where x and y can be anything, not to mention other tags without quotes

limbo

11:05 am on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry Glyphomat. Should have better read your question.

The F&R in DW will not be able to do what you need. You will need something with a little more oomph - jreplace can do this I seem to remember.

glyphomat

1:50 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



thanks Limbo - jreplace is kinda hard to figure out for appending file names -

I found something called WebKitchen - a DW extension but only for DW4 - might have to reinstall DW4 to see if it does what it says

MichaelBluejay

8:50 am on Jan 21, 2005 (gmt 0)

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



You could write a Perl script to do this. And if you don't know Perl -- it's worth learning! :)

doortodoororganics

12:49 pm on Jan 28, 2005 (gmt 0)



i would handle the width=99 problem with EditPlus2.
it's a lite alternative to UltraEdit.

find: height=([0-9]+)
replace: height="\1"

----
if you're dealing with the precent sign..use this.

find: height=([0-9]+)%
replace: height="\1%"

-------
which means:
find where height equals a character in the range 0-9 ...the [ ] means character in range...1 or more times...the + means one or more times.. and store this value as the first variable... \1

replace it with HeightEquals"value of variable 1"

make sure the Regular Expression check box is checked and, if you want to change all open files, click All Open Files.

glyphomat

4:07 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



I'll try that thanks

I should be able to learn perl (I guess) as I use php

I half tried 'html tidy' and HabTidy which are front ends to a cmd line thing called 'tidy' but got distracted so gave up