Copy link to clipboard
Copied
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,
Copy link to clipboard
Copied
Have you tried this:

Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Tried the above suggestion, "Done. None found in 1 document."
Sad
EDIT: Find in "current document - any tag" works - but then the replace action wants to change the div class, not the img class.
Copy link to clipboard
Copied
If you copied exactly what I show in the screen shot, it would mean the description of what you need and what you actually need are slightly different from each other.
Could you post a link to one of your pages so we can see the full code?
Like I mention above, it's probably going to be better (and easier) to just write a css selector for this than to modify every page using F&R.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now