Dreamweaver Videos
Other Website Links

Google Links

 

 

 

 

 

 

Advanced Source code editing using find and replace in Dreamweaver

Press play 2 times! to watch it on video:

Double click video for full screen viewing

 

Macromedia Dreamweaver MX 2004

Using Find and Replace: Source Code

Dreamweaver's Find and Replace is a powerful tool for searching for text in the source code and to make changes to that text within the document you are working on, within selected documents, or throughout your website. The search takes you into the code and stops at each occurrence of the text specified, including meta tags if appropriate.

return to topReplacing Source Code Text: Considerations

The Replace feature is useful when you want to change all or many occurrences of the same text or tags throughout one or more documents. Use this option to replace each occurrence individually. The Find Next feature will then allow you to advance to subsequent occurrences for individual review. The Replace All feature will replace all occurrences with the same replacement text.

WARNING: Use the Replace All option with caution, because all of the designated text or tags will be replaced.

return to topUsing Find and Replace in the Source Code

This section will explain how to use the Find and Replace feature in the source code. In the examples accompanying many of the following steps, we want to change the alt tag of an image to make it more descriptive.

  1. From the Edit menu, select Find and Replace...
    The Find and Replace dialog box appears.

  2. From the Find in pull-down list, select the desired area for the search
    For a description of these options, refer to Where You Can Search: Find in Options.
    EXAMPLE: Select Current Document

  3. From the Search pull-down list, select Source Code
    The Find and Replace dialog box changes to reflect the Source Code options.
    Find and Replace dialog box

  4. In the Find text box, type the source code text you want to replace
    NOTE: It is not necessary to include the tag or attribute, but doing so will help refine your search.
    EXAMPLE: Type alt="UWEC Bldg"

  5. In the Replace text box, type the replacement source code text
    EXAMPLE: Type alt="Photo: Schofield Hall"

  6. OPTIONAL: From the list of options, select options appropriate to your search
    For a description of these options, refer to Additional Find and Replace Options.
    EXAMPLE: Select Ignore whitespace

  7. To find and select the first occurrence of your source code text, click FIND NEXT
    The desired text is selected in the source code.
    NOTE: Clicking FIND ALL will return the results to the Results pane where you can address them.

  8. To replace occurrences of your source code text one by one, click REPLACE
    To replace all occurrences of your source code text with the same replacement source code text, click REPLACE ALL
    NOTE: For more information about these two options, see Replacing Source Code Text: Considerations.

  9. When finished, click CLOSE
    NOTE: The old source code text is replaced with the new source code text.

return to top Using Find Next

Within a given document, Dreamweaver will remember your last search. So, if you close the Find and Replace dialog box to do additional editing, you can resume the prior search using Find Next. The Find and Replace dialog box does not appear, but Find Next locates the next occurrence of the source code text you last searched.

 

eXTReMe Tracker

Google Links

Links:

Pixel2life.com
PHP.net
Learn C#