HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 1st, 2008, 08:49 AM
uniopp uniopp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 111 uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 51 m 33 sec
Reputation Power: 11
Adding ALT tags to an existing site

Hi,
I have a website made up of 400+ pages all of which have images without alt tags. 90% of the images are layout graphics and only need the alt"" added.
Is there any software/plugin that will automate this for me so I don't need to edit each page of my website manually.
Thank You.

Reply With Quote
  #2  
Old May 1st, 2008, 08:59 AM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
Sorry to say this, but I think that you will need to manually just add the alt.
__________________
Adwords Professional
You can give me

Reply With Quote
  #3  
Old May 1st, 2008, 09:05 AM
PHP-Newb PHP-Newb is offline
Bad Coder
Click here for more information
 
Join Date: Jul 2003
Posts: 1,592 PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 15 h 43 m
Reputation Power: 123
No, no you won't. Pick a platform of your choice, such as PHP. Make use of PHP's File functions, then mix some regex in and you will have a script that you can use to automate the addition of your alt variables. Have a look into it and post back if you get stuck.
__________________
Under no circumstances click the button, because it is pointless. Thanks!

Reply With Quote
  #4  
Old May 1st, 2008, 09:20 AM
zer0efx's Avatar
zer0efx zer0efx is offline
The Signal:: It's everywhere!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: San Diego
Posts: 316 zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 563 Folding Title: Novice Folder
Time spent in forums: 3 Days 14 h 26 m
Reputation Power: 46
Send a message via MSN to zer0efx
You can do this pretty easily using DW's Find and Replace.

Just search: Entire Current Local Site
Find: <img[space]
Replace with: <img alt=""[space]

And that will find all img tags on the site, and replace with the same img tag, and add the alt tag.
Comments on this post
sarav_dude agrees!
__________________

Reply With Quote
  #5  
Old May 1st, 2008, 09:23 AM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
That would be a horrible idea for 400+ pages. Take so long.
Comments on this post
sarav_dude disagrees: better than manually editing ...

Reply With Quote
  #6  
Old May 1st, 2008, 10:01 AM
zer0efx's Avatar
zer0efx zer0efx is offline
The Signal:: It's everywhere!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: San Diego
Posts: 316 zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 563 Folding Title: Novice Folder
Time spent in forums: 3 Days 14 h 26 m
Reputation Power: 46
Send a message via MSN to zer0efx
Quote:
Originally Posted by GameYin
That would be a horrible idea for 400+ pages. Take so long.


Actually it wouldn't take that long at all. The engine it uses is pretty good. I've done Find and Replace on sites with 1500+ pages and it worked great!

Reply With Quote
  #7  
Old May 1st, 2008, 11:15 AM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
I think that PHP-newbs idea of PHP would work great. His pages would have to have the img tag set up ALL like
<img alt="" src="whatev.jpg">
Otherwise, your example won't work I think.

Reply With Quote
  #8  
Old May 1st, 2008, 11:27 AM
zer0efx's Avatar
zer0efx zer0efx is offline
The Signal:: It's everywhere!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: San Diego
Posts: 316 zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)zer0efx User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 563 Folding Title: Novice Folder
Time spent in forums: 3 Days 14 h 26 m
Reputation Power: 46
Send a message via MSN to zer0efx
Quote:
Originally Posted by GameYin
I think that PHP-newbs idea of PHP would work great. His pages would have to have the img tag set up ALL like
<img alt="" src="whatev.jpg">
Otherwise, your example won't work I think.


But why write extra code and spend time testing/debugging when a program already contains the task needed.

Agreed, not all images have the same dimensions, or filenames, but all image tags do have something in common. They all do start with <img

So if the user was to do a search for <img and did "Find All" he would get a # result of how many results were found matching the <img criteria. Remember this #.

Now if were to "Find" <img and "Relace" with <img alt="" we aren't extracting anything, we are searching for a common tag used by all image tags, and we are adding to that tag along with a space so as not to mess up the attributes assignment.

After you get finished doing the Global F&R, check the # of results it replace and see if it matched the original # of results found, described in the 2 paragraphs above.

If you really want to make sure, you can go into the Advanced Find and Replace and do even more matching, with certain criteria. DW's F&R feature is quite extensive, and it was made for task exactly as described by the OP.

Try out! Just copy some source code from a large site, and try a simple find and replace. Its def a time saver once you get more comfortable using the feature.

HTH's explain it a little better.

**Edit:
Want to add after I re-read your post.

if a user has an image tag like:
<img src="whatev.jpg">

I am only going to match the first 5 characters
<img[space]

Anything after that I am not touching and it retains it's orginal content.

So if I did a global F&R on the above tag, after the F&R is done, it would look like:
<img alt="" src="whatev.jpg">

Because I replaced:
<img[space]

With:
<img alt=""[space]

Reason why I include the space is so the attributes don't butt up against each other.
Comments on this post
Joseph Taylor agrees!

Last edited by zer0efx : May 1st, 2008 at 11:31 AM. Reason: add more detail

Reply With Quote
  #9  
Old May 1st, 2008, 04:46 PM
PHP-Newb PHP-Newb is offline
Bad Coder
Click here for more information
 
Join Date: Jul 2003
Posts: 1,592 PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level)PHP-Newb User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 15 h 43 m
Reputation Power: 123
I was just thinking general purpose with regards to a script. A grep and replace would be faster for a one-time issue.

Reply With Quote
  #10  
Old May 1st, 2008, 07:27 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Click here for more information.
 
Join Date: Jul 2004
Location: USA
Posts: 15,149 Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 2 Weeks 2 Days 2 h 47 m 18 sec
Reputation Power: 1294
I might use both a text editor with a search and replace in multiple files feature and PHP to do this, because copying that many files via FTP would take a while.

The alt attribute doesn't have to be first either, but it is simpler to do it that way.
__________________
Spreading knowledge, one newbie at a time.

Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

IE7: the generation 7 browser new in a world of generation 8 browsers.
Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

Reply With Quote
  #11  
Old May 2nd, 2008, 04:14 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,590 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 12 h 38 m 48 sec
Reputation Power: 511
You could use Sed, if you got access to it, it is perfect for this kind of work.

http://www.grymoire.com/Unix/Sed.html
http://en.wikipedia.org/wiki/Sed
Comments on this post
PHP-Newb agrees: Good call. I haven't used that in years, forgot of it's existance.
__________________

Reply With Quote
  #12  
Old May 2nd, 2008, 05:26 AM
uniopp uniopp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 111 uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level)uniopp User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 51 m 33 sec
Reputation Power: 11
Thanks for all the replies.
I managed to do it with dreamweaver search and replace.
I did come across a dreamweaver plugin that might be useful for others with a similar problem -
http://divahtml.com/products/divaFr...eaver_tools.php
Thanks.
Comments on this post
Kravvitz agrees!
Joseph Taylor agrees: Nice finish.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Adding ALT tags to an existing site


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump