Anatoliy
Well-known member
I'm creating an addon that serves responsive images using a third part service. So I added a template modification to lightbox_macros and it works.
replace:
However pictures that are displayed with "proxy.php" are broken. So I decided that a solution would be a conditional, but it doesn't work. Pease advice.
Code:
<img src="{$src}"
data-url="{$dataUrl}"
class="bbImage"
data-zoom-target="1"
style="{$styleAttr}"
alt="{$alt|for_attr}"
title="{$title|for_attr}"
width="{$width}" height="{$height}" loading="lazy" />
replace:
Code:
<img src="https://thirdpartydomain/{$src|replace({'https://www.mydomain/':null})}"
data-url="{$dataUrl}"
class="bbImage"
data-zoom-target="1"
style="{$styleAttr}"
alt="{$alt|for_attr}"
title="{$title|for_attr}" loading="lazy" />
However pictures that are displayed with "proxy.php" are broken. So I decided that a solution would be a conditional, but it doesn't work. Pease advice.
Code:
<xf:if is="{{strstr($src, 'proxy.php')}}">
$0
<xf:else />
<img src="https://thirdpartydomain/{$src|replace({'https://www.mydomain//':null})}"
data-url="{$dataUrl}"
class="bbImage"
data-zoom-target="1"
style="{$styleAttr}"
alt="{$alt|for_attr}"
title="{$title|for_attr}" loading="lazy" />
</xf:if>