Hello,
My front-end users would generally create items as follows :
Title : Sunset
Intro Text : Beautiful sunset on the beach with waves
Image caption : "They will skip this field"
I wanted to find a way to use Introtext as alt tag for images. The original code:
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
So I changed :
K2HelperUtilities::cleanHtml($this->item->title)
to:
K2HelperUtilities::cleanHtml($this->item->introtext)
Was thinking that the cleanHtml script would strip the tags <p> so that Intro text :
"<p>Beautiful sunset on the beach with waves</p>"
becomes
"Beautiful sunset on the beach with waves" for alt.
thanks for clarifying.