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
Image description under large switch image
-
easypony
- Phoca Newbie

- Posts: 4
- Joined: 04 May 2010, 15:39
-
easypony
- Phoca Newbie

- Posts: 4
- Joined: 04 May 2010, 15:39
Re: Image description under large switch image
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.
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.
- Benno
- Phoca Hero

- Posts: 9965
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
Re: Image description under large switch image
Well done!
Kind regards,
Benno
Kind regards,
Benno
-
easypony
- Phoca Newbie

- Posts: 4
- Joined: 04 May 2010, 15:39
Re: Image description under large switch image
I have put the code below
added the extra code - - in my - com_phocagallery/views/category/tmpl/default.php around line 167
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:
I hope this helps.
added the extra code -
Code: Select all
displayDescription(\''.$value->description .'\',\''. $value->title .'\');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.'\');"
}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>-
nefachris
- Phoca Newbie

- Posts: 6
- Joined: 21 Mar 2014, 17:30
Re: Image description under large switch image
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.
I wanna have the description (title) under switch image of the showing image. How can I solve this problem?
Thanks.
-
lucas3001
- Phoca Member

- Posts: 43
- Joined: 10 Feb 2015, 15:44
Re: Image description under large switch image
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
and add this
or should I just add all?
because in my com_phocagallery/views/category/tmpl/default.php I don't see anything of similar.
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\', \''.Code: Select all
$switchImg.'\');displayDescription(\''.$value->description .'\',\''. $value->title .'\');" ';
//echo $value->description;
// onmouseout="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \''.$switchImg.'\');"
}because in my com_phocagallery/views/category/tmpl/default.php I don't see anything of similar.