Hi,
I have added a pinterest functionality to a website.
In a custom feature block I have svg images which I would like to exempt from pinterest.
To do this, I need to add nopin="nopin" to my generated image tag:
<?php
if (is_object($f)) {
$image = Core::make('html/image', array($f));
$tag = $image->getTag();
}
$tag-> addClass('image-icon bID-'.$bID);
print $tag;
?>
How do I do this? My php scripting ability is limited, and I would really appreciate some help with this ...
Thanks,
Una
I have added a pinterest functionality to a website.
In a custom feature block I have svg images which I would like to exempt from pinterest.
To do this, I need to add nopin="nopin" to my generated image tag:
<?php
if (is_object($f)) {
$image = Core::make('html/image', array($f));
$tag = $image->getTag();
}
$tag-> addClass('image-icon bID-'.$bID);
print $tag;
?>
How do I do this? My php scripting ability is limited, and I would really appreciate some help with this ...
Thanks,
Una
Hi,
Thanks so much for your time on this.
The code works perfectly to add the attribute to the picture tag, but unfortunately, it seems it needs to be within the image tag to work.
My html output now is:
what I need is this:
Thanks,
Una
Thanks so much for your time on this.
The code works perfectly to add the attribute to the picture tag, but unfortunately, it seems it needs to be within the image tag to work.
My html output now is:
<picture nopin="nopin"> <img src="#" alt="#" class="#"> </picture>
what I need is this:
<picture> <img src="#" alt="#" class="#" nopin="nopin"> </picture>
Thanks,
Una
I see. Try this
Be warned that it will remove the <picture> tag to only keep the <img> tag so if you need the picture tag for responsve reasons it might be a problem.
But if the result you posted is complete, you don't really need that picture tag.
Be warned that it will remove the <picture> tag to only keep the <img> tag so if you need the picture tag for responsve reasons it might be a problem.
But if the result you posted is complete, you don't really need that picture tag.
Perfect, Thank You!
Oh and your code needs some tweaking. It should be like this