Skip to main content
Inspiring
October 9, 2017
Question

Search parameters for advanced find and replace

  • October 9, 2017
  • 2 replies
  • 601 views

I'm struggling with Dw Advanced Find and Replace.

Essentially - I have:

<div class="scheme1">

<img src ..... >

</div>

...that's located in 100s of files on a website. I want to find every "img src" and replace it with "img class="imgclass" src" - ONLY when it appears inside a div with the class set to "scheme1." Is this possible? I've tried with several find and replace parameters and I'm getting "none found" - anyone know what I might be doing wrong? I can post a screenshot if this isn't clear.

Thanks,

This topic has been closed for replies.

2 replies

Jon Fritz
Community Expert
Community Expert
October 9, 2017

It might be easier (and less likely to blow up if not exactly right) to target the <img> tag using a css selector rather than trying to add a class to it in the html. Something like...

.scheme1 img {

     property:value;

     property;value;

}

...in your stylesheet may do the trick, with the added benefit of not needing to save/re-upload/overwrite every page that changes, just the single .css file.

Jon Fritz
Community Expert
Community Expert
October 9, 2017

Have you tried this:

Inspiring
October 9, 2017

No, i was trying to do it as a text find-replace. I'll try that later tonight when I'm back up on my Dw enabled machine. Thanks