H, still trying to solve this.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
In my page class, I have a function that take all images from a selected folder, and returns list of images.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
return ($folder = $this->PortfolioFolder()) ? DataObject::get("Image", "ParentID = '{$folder->ID}'") : false;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
In my template, i have this
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<% control ImagesIDE %>
<img src="$URL" alt="$Caption" />
<% end_control %>
which i wrapped within Fotorama div. Works fine. Note the red bit.
Problem is that i need to acces a caption for that image and my function isnt returning other thing that the $URL variable.
Fotorama uses the alt="..." for description.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Solution i thought of....
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
While looking for solutions, i tryied
<img src="$URL" alt="$Title" />
and it returned this
<img src="...." alt="image_aaa.jpg" />
So i said, where does that comes from? Quickly, i thought about the FILES pabel into the CMS. Yes, there is a title there.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QUESTION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Is there a way i could add another textfield into that part of the CMS? Like that:
So i could use
<img src="$URL" alt="$Caption" />
Thanks!