Hi,
In the category page, the thumbnail images have an ALT attribute in source view. However, the ALT attribute in empty in Product detail page.
Could you please suggest what change is required, so that ALT attribute has values in Product detail page. This will help in SEO.
Thanks.
Did you tried to use forum search button before you post?
I did a search. There were many threads with similar problem, but could not find a solution.
Quote from: ivus on August 02, 2012, 09:10:36 AM
Hi communion,
That's because your code is badly formed.
<div class="main-image">
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" alt="'.$this->product->text.'" ',true,' title="'.$this->product->product_name.'" ',true,' rel="prettyPhoto[pp_gal]" id="medium-image"', false ); ?>
</div>
the function has the following parameters:
function displayMediaFull($imageArgs='', $lightbox=true, $effect="class='modal'", $description = true ){}
not sure what you are trying to pass into it...
I hope this helps. ;D
Not sure which file to be edited.
However I found a similar code in components/com_virtuemart/views/productdetails/tmpl/default_images.php which is as below:
<div class="main-image">
<?php
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
?>
<div class="clear"></div>
</div>
<?php
$count_images = count ($this->product->images);
if ($count_images > 1) {
?>
<div class="additional-images">
<?php
for ($i = 1; $i < $count_images; $i++) {
$image = $this->product->images[$i];
?>
<div class="floatleft">
<?php
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
?>
</div>
If this file is correct, could you let me know what shoule be changed in this?
What is your VM version? Do you have template overrides?
And .. don't you see how displayMediaFull is formed in my and yours code peaces?
I'm using VM 2.0.18a and I do not have overrides for product detail page.
Maybe update?
Do I need to edit
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
inorder to change the ALT and Title?
Yes
I was able to get the Title tag after changing the code as:
echo $image->displayMediaFull('title="'.$this->product->product_name.'" ',true,"rel='vm-additional-images' ");
However, I am not getting the ALT tag established. Can you please assist where should I write the code for ALT tag having the Product name.
Thanks.
I use VM 2.0.22c and I do not see that issue. If you did not give your pictures a personalized alt description VM takes the product name as alt tag -> automatically. There is no need to overwrite something.