Author Topic: image title=  (Read 577 times)

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
image title=
« on: October 26, 2020, 09:52:34 am »
Hello. I have tempalte from olympiatheme deployed on the web selling bows and crossbows. And I need to get one thing out. For images, I want to display title = "" next to the alt attribute
Unfortunately, I can't figure out which files I need to search. I haven't been lucky yet. Can you please advise? I need to edit the code to display title = "" on images in categories, in the category and in the product detail. Thank you for your advice.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10423
  • VirtueMart Version: 3+
Re: image title=
« Reply #1 on: October 26, 2020, 18:41:35 pm »
where at? product page? category page?

product page
default_images.php
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #2 on: October 26, 2020, 19:13:03 pm »
where at? product page? category page?

product page
default_images.php

in categories

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 817
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: image title=
« Reply #3 on: October 27, 2020, 01:52:32 am »
Martine,

why you don't learn debug php code?
I'm not a developer, but after 3 years in company EasySoftware and now 4 years in Minion I know how find the right function.
You know php, then you can learn how debug code.
Good for debug is PHPStorm, but you can find in ftp in terminal very quickly.

If you need to add params title="XXX" to code <img.... >, then you must create hack for internal Joomla function "image" inside this file:

libraries/cms/html/html.php

or write your custom SEO plugin with override this function
or use of any SEO plugins for joomla - try to find on Google.

Or maybe you can try another way - with function replace in PHP inside sublayout "product.php"

You have a lot of variants, how you can walk to END/CÍL.


Add more info about title:
“title has a number of accessibility problems, mainly based around the fact that screen reader support is very unpredictable and most browsers won’t show it unless you are hovering with a mouse (so e.g. no access to keyboard users).”

I think more important is adding height and weight for all pictures, than title :D

P.S.
My tutorials and answers are just a helping hand to finding your right way to go == they will never contain program code because I'm not a freelancer.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #4 on: October 27, 2020, 06:44:37 am »
Thx.

Height and weight can JCH Optimise.

But, in category administration i can setup meta title. But this title vm cant show on categories page. I dnot know why? But I must go to ftp, find file, and change it.

PS: Sry for my bad english.

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #5 on: November 14, 2020, 11:32:23 am »
Hi all.
I need a simple code modification in the category listing . . .

Code: [Select]
<div class="category <?php echo $category_cellwidth ?>">
      <div class="thumbnail">
        <a href="<?php echo $caturl ?>" <?php echo $ajaxUpdate?> >
          <div class="text-center" data-mh="image-wrapper">
            <?php echo $category->images[0]->displayMediaThumb('class="browseCategoryImage"',false); ?>
          </div>
          <div class="caption text-center" data-mh="cat-name">
            <hr>
            <h2 class="vm-cat-title">
              <?php echo vmText::_($category->category_name?>
            </h2>
          </div>
        </a>
      </div>
    </div>

and need add to image categories title.


My suggestion is:
Code: [Select]
<div class="text-center" data-mh="image-wrapper">
     <?php echo $category->images[0]->displayMediaThumb('title="XXX" class="browseCategoryImage"',false); ?>
</div>

a místo xxx potřebuji zobrazit: <?php echo vmText::_($category->category_name) ?>

But those heads are spinning from those brackets :)

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #6 on: November 14, 2020, 12:13:01 pm »
My first test dont work :)
Code: [Select]
<?php echo $category->images[0]->displayMediaThumb('title="'<?php echo vmText::_($category->category_name?>'" class="browseCategoryImage"',false); ?>

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #7 on: November 14, 2020, 12:32:03 pm »
um, there's a mess in that system. All images are missing the title attribute. And the alt attribute is retrieved from the unknown. The development team are great programmers, but you would need an SEO speshitpillt to join the team :)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3306
  • VirtueMart Version: 3.8.4
Re: image title=
« Reply #8 on: November 14, 2020, 13:30:33 pm »
Quote
And the alt attribute is retrieved from the unknown.

Or maybe it is created from the function displayMediaThumb in mediahandler.php

and then further in function displayIt(

However to help you out, maybe this should give you an idea of how to get what you want:

Code: [Select]
echo $category->images[0]->displayMediaThumb('title="'. vmText::_($category->category_name) .'" alt="'. vmText::_($category->category_name) .'" class="browseCategoryImage"',false);
regards
A

Joomla 3.9.23
php 7.3

marvays

  • Jr. Member
  • **
  • Posts: 345
    • richta.cz
  • Skype Name: marvays
Re: image title=
« Reply #9 on: November 14, 2020, 13:48:49 pm »
It works great. Thank you very much. God will repay you for your children :)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3306
  • VirtueMart Version: 3.8.4
Re: image title=
« Reply #10 on: November 14, 2020, 13:55:42 pm »
Glad to know it worked for you  :)

Fortunately I am not seeking divine payments.
regards
A

Joomla 3.9.23
php 7.3