ReReplacer

Adding Alt text to Joomla Field Image

1 month 3 weeks ago #90655

Ian Thatcher's Avatar Ian Thatcher

Peter, this plugin has to be one of the most powerful in the armoury and it has helped on many occasions. I seem to be entering the wrong settings for the problem that I have as I cant get the alt text added.

Source code is

<dd class="field-entry field-avatar">	<span class="field-label ">Avatar: </span>
<span class="field-value"><img src="/images/avatar/pudenski-brothers-400px.jpg"></span>
</dd>

I would like to change it to
<dd class="field-entry field-avatar">	<span class="field-label ">Avatar: </span>
<span class="field-value"><img src="/images/avatar/pudenski-brothers-400px.jpg" alt="pudenski-brothers-avatar"></span>
</dd>

I am currently enabled in everywhere and have tested the replacement on some article text which works fine.

1 month 3 weeks ago #90658

Peter van Westen's Avatar Peter van Westen Admin

In many cases the leading slash in urls is not yet there at the time the html code is passed through the Joomla plugins - so also ReReplacer.
Joomla adds these at a later (pretty much the last) stage in the rendering process.

So you could try doing the search without that leading slash in the url.
Or use Regular Expressions to make the search more dynamic.

You could simply search for:

pudenski-brothers-400px.jpg"></span>
and replace it with:
pudenski-brothers-400px.jpg" alt="pudenski-brothers-avatar"></span>

1 month 2 weeks ago #90695

Ian Thatcher's Avatar Ian Thatcher

Simple as that, sorted and thanks very much

Thatch