Image description under large switch image

Phoca Gallery - image gallery extension
easypony
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 04 May 2010, 15:39

Image description under large switch image

Post 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
easypony
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 04 May 2010, 15:39

Re: Image description under large switch image

Post 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.
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9966
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Image description under large switch image

Post by Benno »

Well done! :twisted:
Kind regards,
Benno
easypony
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 04 May 2010, 15:39

Re: Image description under large switch image

Post 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">&nbsp;</li>
                        <li id="p1">&nbsp;</li>
                    </ul>
I hope this helps.
nefachris
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 21 Mar 2014, 17:30

Re: Image description under large switch image

Post 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.
lucas3001
Phoca Member
Phoca Member
Posts: 43
Joined: 10 Feb 2015, 15:44

Re: Image description under large switch image

Post 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.
Post Reply