VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: hk on April 27, 2014, 12:31:24 PM

Title: Set up a Plugin
Post by: hk on April 27, 2014, 12:31:24 PM
Hi,

The ALT tags in the image is blank. For better SEO of site, I need to hack the core file to customize function displayMediaThumb:
administrator/components/com_virtuemart/helpers/image.php

Can you let me know how can I write a plugin to hack the core file, so that it doesn't affect when I upgrade the VM version. I never developed a Plugin/Module/Component for Joomla/Virtuemart. Please guide me what the files to be used for plugin and naming convention (if any).

Using VM 2.0.26d

Thanks.
Title: Re: Set up a Plugin
Post by: JoomTut on April 28, 2014, 08:37:55 AM
- Upgrade your VM to latest version.
- Enter your text in Product Images -> Image Alt-Text
Title: Re: Set up a Plugin
Post by: hk on April 28, 2014, 08:41:03 AM
I'm using 2.0.26d
As I have 1000s of products uploaded, its time consuming to update Alt for all products. Instead, I would edit image.php to have product name as ALT.
Title: Re: Set up a Plugin
Post by: AH on April 28, 2014, 12:22:11 PM
Yep I would go for using the product name as the ALT tag and not use the data on the product page, makes it much easier to add a product and not worry about alt text being nonsense

Setup an vm - images.php override in your template file
Title: Re: Set up a Plugin
Post by: hk on April 28, 2014, 12:25:34 PM
Thanks!
Can you provide me the path where should I put the images.php in the template.
Also let me know whether the override file should contain only the function which I need to edit OR it should contain the entire code.
Title: Re: Set up a Plugin
Post by: hk on May 17, 2014, 09:18:01 AM
Any suggestions how to show Alt tag for all products.
Title: Re: Set up a Plugin
Post by: JoomTut on May 18, 2014, 09:08:43 AM
Do you want ALT tag as image file name or Product name?
ALT tag only or with TITLE tag?
Work on category page or (and) Product Detail page?
Title: Re: Set up a Plugin
Post by: hk on May 20, 2014, 18:06:20 PM
Quote from: JoomTut on May 18, 2014, 09:08:43 AM
Do you want ALT tag as image file name or Product name?
ALT tag only or with TITLE tag?
Work on category page or (and) Product Detail page?
I need both TITLE tag and ALT tag as Product name in Category as well as Product Detail page.