[Skip to main content](#vessel-content)

#   Display image title in product &gt; show\_block\_img

##

- **[Lutya](/forum/user/23439-lutya "View Lutya's Profile")**
- [![Lutya's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/23439-lutya "View Lutya's Profile") Topic Author
- [ Offline](/forum/user/23439-lutya)

Less More

- Posts: 56
- Thank you received: 0
-
-

13 years 2 months ago [\#120315](#120315) by [Lutya](/forum/user/23439-lutya "View Lutya's Profile")  *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120315 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")* was created by *[Lutya](/forum/user/23439-lutya "View Lutya's Profile")*

I want to display the current images title in the product &gt; show_block_img view. I was able to achieve this on page load by adding Code:

&lt;div id="title"&gt;&lt;?php echo $image-&gt;file_name ?&gt;&lt;/div&gt;

below my image. However I need to find a way to trigger it onmouseover for the thumbnails, like the "hikashopChangeImage" function does for the a class "hikashop_image_small_link".

[ bellaraejewelry.com/joomla/index.php?opt...ame=se-04&amp;Itemid=159](http://bellaraejewelry.com/joomla/index.php?option=com_hikashop&ctrl=product&task=show&cid=4&name=se-04&Itemid=159)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 2 months ago [\#120372](#120372) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120372 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

Only the image itself is updated on mouse over. To add the refresh of the name, that won't be easy. You'll have to add that in the javascript code of the display function of the file administrator/components/com_hikashop/helpers/image.php

The following user(s) said Thank You: [Lutya](/forum/user/23439-lutya "View Lutya's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Lutya](/forum/user/23439-lutya "View Lutya's Profile")**
- [![Lutya's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/23439-lutya "View Lutya's Profile") Topic Author
- [ Offline](/forum/user/23439-lutya)

Less More

- Posts: 56
- Thank you received: 0
-
-

13 years 2 months ago -  13 years 2 months ago [\#120444](#120444) by [Lutya](/forum/user/23439-lutya "View Lutya's Profile")  Replied by *[Lutya](/forum/user/23439-lutya "View Lutya's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120444 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

Thank you so much! That's what I needed to get this done.

For future reference:

On line 201 of the image.php file, where the function hikashopChangeImage is defined, you need to add a way to dynamically change the innerHTML of the element that contains the ID of the title of your image. So for my &lt;div id="title"&gt;&lt;?php echo $image-&gt;file_name ?&gt;&lt;/div&gt; that I added to my product &gt; show_block_img view to change with the new displayed image, I added:
Code:

title = document.getElementById(\'title\'); if(title){ if(nAlt) title.innerHTML=nTitle; }

Just below line 233 of the image.php file.

It was actually a pretty simple solution once I new the correct php file to edit.

Last edit: 13 years 2 months ago by [Lutya](/forum/user/23439-lutya "View Lutya's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")**
- [![Sovaka's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27194-sovaka "View Sovaka's Profile")
- [ Offline](/forum/user/27194-sovaka)

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 2 months ago -  13 years 2 months ago [\#120776](#120776) by [Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")  Replied by *[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120776 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

Could you have not added to the show_block_img;

&lt;div id="ImgTitle" onmouseover="showTitle();" onmouseout="hideTitle();"&gt;&lt;?php echo $image-&gt;file_name ?&gt;&lt;/div&gt;

Then just add a function to your base Index Template of;
Code:

function showTitle() { var ImgTitle = document.getElementById('ImgTitle'); ImgTitle.style.display = 'block'; } function hideTitle() { var ImgTitle = document.getElementById('ImgTitle'); ImgTitle.style.display = 'none'; }

That way you could stylize the div to suit your needs and just have it show and unshow on hover.
Also, this reduces the amount of "hacking" you need to do to base files for HikaShop for when you update it.

.: ETA :.
Oh, you'd need to add to the default CSS of the #ImgTitle that its 'display' is initially set to 'none' so that it isn't visible before hover.

Last edit: 13 years 2 months ago by [Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile"). Reason: Fixed some code reference errors.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Lutya](/forum/user/23439-lutya "View Lutya's Profile")**
- [![Lutya's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/23439-lutya "View Lutya's Profile") Topic Author
- [ Offline](/forum/user/23439-lutya)

Less More

- Posts: 56
- Thank you received: 0
-
-

13 years 2 months ago [\#120777](#120777) by [Lutya](/forum/user/23439-lutya "View Lutya's Profile")  Replied by *[Lutya](/forum/user/23439-lutya "View Lutya's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120777 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

If you put the onmouseover event in the div containing the title, then the title wouldn't change unless the user moused over that title - not the thumbnail. If you put the onmouseover event in the thumbnail (like the hikashopChangeImage function is) then it doesn't work for some reason - probably something to do with the PHP on the page setting the attributes you are pulling. I had to actually include it in the hikashopChangeImage function defined in the php file "image.php".

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")**
- [![Sovaka's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27194-sovaka "View Sovaka's Profile")
- [ Offline](/forum/user/27194-sovaka)

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 2 months ago -  13 years 2 months ago [\#120778](#120778) by [Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")  Replied by *[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120778 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

Hmm good point, sorry about that mistake.
However you can still get around it by placing the 'show_image_block' within a &lt;div id="ShowImgTitle" onmouseover="showTitle();" onmouseout="hideTitle();"&gt;&lt;?php "show_block_image" ?&gt;&lt;/div&gt;
Then using the same function code as above, it will result in a Hover Div display over the Image but will be triggered by the image itself essentially.

.: ETA :.
Though to be honest, your code is a whole lot simpler to achieve the same result.
That being said, you'll just need to take note of "how, where and what" you did to get the result for when you update HikaShop next.

I have a similar issue with my modifications I have done to Kunena.

It's a pain in the arse.

Last edit: 13 years 2 months ago by [Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile"). Reason: ETA

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Lutya](/forum/user/23439-lutya "View Lutya's Profile")**
- [![Lutya's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/23439-lutya "View Lutya's Profile") Topic Author
- [ Offline](/forum/user/23439-lutya)

Less More

- Posts: 56
- Thank you received: 0
-
-

13 years 2 months ago [\#120779](#120779) by [Lutya](/forum/user/23439-lutya "View Lutya's Profile")  Replied by *[Lutya](/forum/user/23439-lutya "View Lutya's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120779 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

That might actually work... except it might try to trigger before the thumbnail changes the image since the thumbnails are contained in show_block_image. This would result in it pulling the title tag for the old image.

Either way, the simple adjustment to the php worked just fine.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")**
- [![Sovaka's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27194-sovaka "View Sovaka's Profile")
- [ Offline](/forum/user/27194-sovaka)

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 2 months ago [\#120780](#120780) by [Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")  Replied by *[Sovaka](/forum/user/27194-sovaka "View Sovaka's Profile")* on topic *[Display image title in product &gt; show\_block\_img](/forum/4-how-to/861386-display-image-title-in-product-show-block-img#120780 "I want to display the current images title in the product &gt; show&#95;block&#95;img view. I was able to achieve this on page load by adding below my image. However I need to find a way to trigger it...")*

Yeah, you'd have to add a subsection for the Thumbnail version and you'd need to parameterize the ShowImgTitle.
So if you had multiple of img blocks, it wouldn't trigger all of their div popups ![:p](/media/kunena/emoticons/14.png ":p")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTM4Ni1kaXNwbGF5LWltYWdlLXRpdGxlLWluLXByb2R1Y3Qtc2hvdy1ibG9jay1pbWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.074 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
