Page 1 of 1
Image description under large switch image
Posted: 04 May 2010, 15:59
by easypony
I have been searching the forum on and off for a few days and experimenting with no luck. I wish to display the image description under the switch image. I have the large image displaying on the right with the thumbnails on the left. I cannot seem to find the variable that holds the description text.
I wish to add it in the - com_phocagallery/views/category/tmpl/default.php
Re: Image description under large switch image
Posted: 05 May 2010, 01:30
by easypony
Solved!
I created a p tag under the image in the "Switch image" HTML call at the top of com_phocagallery/views/category/tmpl/default.php then added a javascript function with one parameter to write the innerHTML of the p tag at the top of the page.
Then on the mouseover event for the switchimage (round line 152) I added the javascript function with the paramter of "$value->description"
Now when you mouse over the thumbnail the image description appears.
Re: Image description under large switch image
Posted: 06 May 2010, 13:49
by Benno
Well done!
Kind regards,
Benno
Re: Image description under large switch image
Posted: 17 May 2010, 06:59
by easypony
I have put the code below
added the extra code -
Code: Select all
displayDescription(\''.$value->description .'\',\''. $value->title .'\');
- in my - com_phocagallery/views/category/tmpl/default.php around line 167
Code: Select all
} else {
$switchImg = str_replace('phoca_thumb_m_','phoca_thumb_l_',JURI::base(true).'/'. $value->linkthumbnailpath);
echo ' onmouseover="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \''. $switchImg.'\');displayDescription(\''.$value->description .'\',\''. $value->title .'\');" ';
//echo $value->description;
// onmouseout="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \''.$switchImg.'\');"
}
Then at the top of the same file in the switch HTML call (round line 42) I added the javascript function and the extra mark-up:
Code: Select all
<script type="text/javascript">
function displayDescription(text, title){
document.getElementById("p1").innerHTML= text;
document.getElementById("p2").innerHTML= title;
}
</script>
<div id="switchholder" align="center" style="text-align:center;width:<?php echo $switchImage['width'];?>px;height:<?php echo $switchImage['height'];?>px; background: url('<?php echo $this->tmpl['waitimage']; ?>') <?php echo $switchImage['centerw'] ;?>px <?php echo $switchImage['centerh'];?>px no-repeat;margin:0px;padding:0px;"><?php echo $this->tmpl['basicimage'] ?>
</div>
<ul class="switchlist">
<li id="p2"> </li>
<li id="p1"> </li>
</ul>
I hope this helps.
Re: Image description under large switch image
Posted: 21 Mar 2014, 17:35
by nefachris
I'm searching now for the same problem.
I wanna have the description (title) under switch image of the showing image. How can I solve this problem?
Thanks.
Re: Image description under large switch image
Posted: 11 May 2015, 14:10
by lucas3001
Hi
thank you for this hint.
however I don't undrestand:
should I find in
com_phocagallery/views/category/tmpl/default.php
this initial code
Code: Select all
} else {
$switchImg = str_replace('phoca_thumb_m_','phoca_thumb_l_',JURI::base(true).'/'. $value->linkthumbnailpath);
echo ' onmouseover="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \''.
and add this
Code: Select all
$switchImg.'\');displayDescription(\''.$value->description .'\',\''. $value->title .'\');" ';
//echo $value->description;
// onmouseout="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \''.$switchImg.'\');"
}
or should I just add all?
because in my com_phocagallery/views/category/tmpl/default.php I don't see anything of similar.