Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Voices That Matter

  • Print
  • + Share This
This chapter is from the book

Searching Text, Code, or Tags

Beyond the standard find and replace functions, you’d expect, Expression Web also lets you search and replace bits of your code across an entire Web site. That can be especially handy when trying to track down problems. The Find and Replace dialog box’s many options make it easy to zero in on even the tiniest bit of code across the largest of sites. It also includes an option to search and change just HTML tags.

To find text or code on a single page:

  1. To search a single page, open it or select it in the Folder List.
  2. Choose Edit > Find (ctrl-f.gif).
  3. In the Find and Replace dialog box, type what you’re searching for in the Find what field or click the field’s drop-down menu and choose an appropriate item (Figure 4.53).
    Figure 4.53

    Figure 4.53 In the Find and Replace dialog box, you can use the Find what field’s drop-down menu or type in your own text.

  4. Use the Search options pane to specify where to look, the direction of the search, or such things as the case of the item.
  5. If you click Find Next, the search item is highlighted (Figure 4.54). The page remains visible, enabling you to use the Find Next button to move through the page.

    Figure 4.54

    Figure 4.54 The search item is highlighted in the page (top). Click the Next button to move through the page.

    or

    If you click Find All, the first instance of the search item is highlighted in the page and the Find and Replace dialog box is replaced by the Find pane listing all the instances found. Click the Find pane’s blue Next or Back arrows to continue searching the page. To close the Find pane, click the X in the pane’s title bar.

To find text or code across the site:

  1. Open the site you want to search, and select its name in the Folder List (Figure 4.55).

    Figure 4.55

    Figure 4.55 To search an entire site, select its name in the Folder List.

  2. Choose Edit > Find.
  3. In the Find and Replace dialog box, type in the Find what box the term you’re searching for or use the field’s drop-down menu to choose an appropriate item. If necessary, use the Advanced pane to further hone the search. Click Find All (Figure 4.56).

    Figure 4.56

    Figure 4.56 Type in the Find what box the term you’re searching for, use the Advanced pane to further hone the search, and click Find All.

    A Find pane lists the search results by page, line number, and context (Figure 4.57).

    Figure 4.57

    Figure 4.57 A Find pane lists the search results by page, line number, and context.

  4. Click the Find pane’s blue Next result arrow, and Expression Web automatically opens the page containing the search term and highlights it in context (Figure 4.58).

    Figure 4.58

    Figure 4.58 Click the Find pane’s Next arrow, and the page containing the term opens automatically.

  5. Click the Find pane’s blue Next result arrow to see the next instance of the search term, or click the blue Back arrow to see the previous instance. To close the Find pane, click the X in the pane’s title bar.

To find and replace HTML tags:

  1. In the Folder List, select the entire site, single page, or multiple pages (using ctrl.gif-click) in which you want to find a particular HTML tag, and choose Edit > Find.
  2. In the Find and Replace dialog box, select the HTML Tags tab. Set up what you want to find and replace using the Find tag, Replace action, and To drop-down menus (Figure 4.59).

    Figure 4.59

    Figure 4.59 In the HTML Tags tab, set up what you want to find and replace using the Find tag, Replace action, and To drop-down menus.

  3. If you want, use the Find where section of the Search options pane to expand or narrow the pages searched and the Advanced section to further hone the search. Since Expression Web cannot undo a replace-all action, click Find All (not Replace All).
  4. When the Find pane displays the search results, look through the Matched Text column to see if Expression Web found what you wanted. If you have any doubts, select the page listing and click the blue Next result arrow (Figure 4.60). The page opens so that you can get a better look.

    Figure 4.60

    Figure 4.60 When the Find pane displays the search results, look through the Matched Text column to see if Expression Web found what you wanted.

  5. Once you’ve taken a good look at the results, click the green arrow at the top of the Find pane (Figure 4.61).

    Figure 4.61

    Figure 4.61 Click the arrow at the top of the Find pane to return to the Find and Replace dialog box.

    The Find and Replace dialog box reappears.

  6. (Optional) If necessary, you can adjust the find and replace actions and then, if you’re being extra careful, select Find 2 in the Display results in section (Figure 4.62). Click Find All again, and a second tab appears in the Find pane (Figure 4.63). Switch between the two tabs to compare the results. Repeat step 5 to return to the Find and Replace dialog box until you’re satisfied with the results. Then return to the Find and Replace dialog box one last time.

    Figure 4.62

    Figure 4.62 You can adjust the find and replace actions and display the results in a new pane by selecting Find 2.

    Figure 4.63

    Figure 4.63 By switching the Find 1 and Find 2 tabs, you can compare the results of both searches.

  7. Click Replace All in the Find and Replace dialog box (Figure 4.64). Assuming you’ve doubled-checked your work, click Yes when the alert dialog box appears (Figure 4.65).

    Figure 4.64

    Figure 4.64 Since the action cannot be reversed, make sure you’re ready before clicking Replace All.

    Figure 4.65

    Figure 4.65 Assuming you’ve doubled-checked your work, click Yes.

    Expression Web makes the replacements and lists the actions in the Find pane (Figure 4.66).

    Figure 4.66

    Figure 4.66 Expression Web makes the replacements and lists the actions in the Find pane.

  • + Share This
  • 🔖 Save To Your Account