Magento 2: How to add title tag in product image in product details page?Magento Title tag seoHow to add a canonical tag on the login pageShow breadcrumb on product details pageHow reset page title category magento 1Remove default page title suffix from home page (or any specific page)Home page title disappearsMagento 2 Product title with meta title in product viewProblem with tag titleBest Seller Block (links not working) - Magento 2.2How to remove the inner HTML of my H1 Page title tag?

When to remove insignificant variables?

LWC - Local Dev - How can I run the local server on HTTPS?

Why are < or > requried to use /dev/tcp

What does it mean to not be able to take the derivative of a function multiple times?

Do I have to explain the mechanical superiority of the player-character within the fiction of the game?

How do I farm creepers for XP without them exploding?

Identifying a distribution

Dates on degrees don’t make sense – will people care?

Should an enameled cast iron pan be seasoned?

Intuition for the role of diffeomorphisms

Similarity score: Can Sklearn SVR predict values greater than 1 and less than 0?

Confusion over 220 and 230 volt outlets

Is Famished Paladin and Resplendent Mentor a legal infinite life combo?

Why does the Saturn V have standalone inter-stage rings?

Why does using different ArrayList constructors cause a different growth rate of the internal array?

How long would it take to cross the Channel in 1890's?

King or Queen-Which piece is which?

Explain why a line can never intersect a plane in exactly two points.

I don't like coffee, neither beer. How to politely work my way around that in a business situation?

How would modern naval warfare have to have developed differently for battleships to still be relevant in the 21st century?

Is it illegal to withhold someone's passport and green card in California?

Why is it recommended to mix yogurt starter with a small amount of milk before adding to the entire batch?

How did Gollum enter Moria?

Is there a term for the belief that "if it's legal, it's moral"?



Magento 2: How to add title tag in product image in product details page?


Magento Title tag seoHow to add a canonical tag on the login pageShow breadcrumb on product details pageHow reset page title category magento 1Remove default page title suffix from home page (or any specific page)Home page title disappearsMagento 2 Product title with meta title in product viewProblem with tag titleBest Seller Block (links not working) - Magento 2.2How to remove the inner HTML of my H1 Page title tag?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















How to add title tag in product image in product details page?



current img tag in product detail page



<img src="image.jpg" alt="hello" class="fotorama__img" aria-hidden="false">


I want to add title tag like:



<img src="image.jpg" alt="hello" title="hello" class="fotorama__img" aria-hidden="false">


Please let me know any suggestion to do this.










share|improve this question






















  • Do you want to add a caption to the Image ?

    – nikin
    Jul 19 '18 at 5:59











  • I want to add title, not caption.

    – Purushotam Sharma
    Jul 19 '18 at 6:02











  • Did you find the way to add title? I have the same problem.

    – vesna
    Jun 12 at 12:13











  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

    – Jai
    Jun 12 at 12:32

















0















How to add title tag in product image in product details page?



current img tag in product detail page



<img src="image.jpg" alt="hello" class="fotorama__img" aria-hidden="false">


I want to add title tag like:



<img src="image.jpg" alt="hello" title="hello" class="fotorama__img" aria-hidden="false">


Please let me know any suggestion to do this.










share|improve this question






















  • Do you want to add a caption to the Image ?

    – nikin
    Jul 19 '18 at 5:59











  • I want to add title, not caption.

    – Purushotam Sharma
    Jul 19 '18 at 6:02











  • Did you find the way to add title? I have the same problem.

    – vesna
    Jun 12 at 12:13











  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

    – Jai
    Jun 12 at 12:32













0












0








0








How to add title tag in product image in product details page?



current img tag in product detail page



<img src="image.jpg" alt="hello" class="fotorama__img" aria-hidden="false">


I want to add title tag like:



<img src="image.jpg" alt="hello" title="hello" class="fotorama__img" aria-hidden="false">


Please let me know any suggestion to do this.










share|improve this question














How to add title tag in product image in product details page?



current img tag in product detail page



<img src="image.jpg" alt="hello" class="fotorama__img" aria-hidden="false">


I want to add title tag like:



<img src="image.jpg" alt="hello" title="hello" class="fotorama__img" aria-hidden="false">


Please let me know any suggestion to do this.







seo magento2.2.3 title






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 19 '18 at 5:55









Purushotam SharmaPurushotam Sharma

9011831




9011831












  • Do you want to add a caption to the Image ?

    – nikin
    Jul 19 '18 at 5:59











  • I want to add title, not caption.

    – Purushotam Sharma
    Jul 19 '18 at 6:02











  • Did you find the way to add title? I have the same problem.

    – vesna
    Jun 12 at 12:13











  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

    – Jai
    Jun 12 at 12:32

















  • Do you want to add a caption to the Image ?

    – nikin
    Jul 19 '18 at 5:59











  • I want to add title, not caption.

    – Purushotam Sharma
    Jul 19 '18 at 6:02











  • Did you find the way to add title? I have the same problem.

    – vesna
    Jun 12 at 12:13











  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

    – Jai
    Jun 12 at 12:32
















Do you want to add a caption to the Image ?

– nikin
Jul 19 '18 at 5:59





Do you want to add a caption to the Image ?

– nikin
Jul 19 '18 at 5:59













I want to add title, not caption.

– Purushotam Sharma
Jul 19 '18 at 6:02





I want to add title, not caption.

– Purushotam Sharma
Jul 19 '18 at 6:02













Did you find the way to add title? I have the same problem.

– vesna
Jun 12 at 12:13





Did you find the way to add title? I have the same problem.

– vesna
Jun 12 at 12:13













This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

– Jai
Jun 12 at 12:32





This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review

– Jai
Jun 12 at 12:32










2 Answers
2






active

oldest

votes


















0














The title-tag is good for nothing. Yes google themselves say to add a title to the image.
Unfortunately most seo specialists have no idea what they are doing and didn't get that google does not talk about the title-tag at all.
Google specifically states that you need to provide the alt-tag!




Lastly, optimizing your image filenames and alt text makes it easier for image search projects like Google Image Search to better understand your images.




https://support.google.com/webmasters/answer/7451184






share|improve this answer























  • Btw. I used your wording, but title and alt are actually attributes not a tags.

    – steros
    Jul 19 '18 at 6:16



















0














You want to bring image_with_borders.phtml template file into your theme.



https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml



Then it's something like this



<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /** @var $block MagentoCatalogBlockProductImage */ ?>

<span class="product-image-container"
style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
<span class="product-image-wrapper"
style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
<img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
<?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>
title="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
</span>


Uses image label. But that might be safer?



But if you want product name try



$block->getProduct()->getName();



but if that doesnt work



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product = $objectManager->get('MagentoFrameworkRegistry')->registry('product');
$name = $product ? $product->getName() : null;


Which isn't perfect but close enough.



The better solution would be to modify MagentoCatalogBlockProductImage in an extension and then inject registry



https://blog.qaisarsatti.com/magento_2/magento-2-get-current-product-information/






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f235066%2fmagento-2-how-to-add-title-tag-in-product-image-in-product-details-page%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The title-tag is good for nothing. Yes google themselves say to add a title to the image.
    Unfortunately most seo specialists have no idea what they are doing and didn't get that google does not talk about the title-tag at all.
    Google specifically states that you need to provide the alt-tag!




    Lastly, optimizing your image filenames and alt text makes it easier for image search projects like Google Image Search to better understand your images.




    https://support.google.com/webmasters/answer/7451184






    share|improve this answer























    • Btw. I used your wording, but title and alt are actually attributes not a tags.

      – steros
      Jul 19 '18 at 6:16
















    0














    The title-tag is good for nothing. Yes google themselves say to add a title to the image.
    Unfortunately most seo specialists have no idea what they are doing and didn't get that google does not talk about the title-tag at all.
    Google specifically states that you need to provide the alt-tag!




    Lastly, optimizing your image filenames and alt text makes it easier for image search projects like Google Image Search to better understand your images.




    https://support.google.com/webmasters/answer/7451184






    share|improve this answer























    • Btw. I used your wording, but title and alt are actually attributes not a tags.

      – steros
      Jul 19 '18 at 6:16














    0












    0








    0







    The title-tag is good for nothing. Yes google themselves say to add a title to the image.
    Unfortunately most seo specialists have no idea what they are doing and didn't get that google does not talk about the title-tag at all.
    Google specifically states that you need to provide the alt-tag!




    Lastly, optimizing your image filenames and alt text makes it easier for image search projects like Google Image Search to better understand your images.




    https://support.google.com/webmasters/answer/7451184






    share|improve this answer













    The title-tag is good for nothing. Yes google themselves say to add a title to the image.
    Unfortunately most seo specialists have no idea what they are doing and didn't get that google does not talk about the title-tag at all.
    Google specifically states that you need to provide the alt-tag!




    Lastly, optimizing your image filenames and alt text makes it easier for image search projects like Google Image Search to better understand your images.




    https://support.google.com/webmasters/answer/7451184







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 19 '18 at 6:08









    sterossteros

    862730




    862730












    • Btw. I used your wording, but title and alt are actually attributes not a tags.

      – steros
      Jul 19 '18 at 6:16


















    • Btw. I used your wording, but title and alt are actually attributes not a tags.

      – steros
      Jul 19 '18 at 6:16

















    Btw. I used your wording, but title and alt are actually attributes not a tags.

    – steros
    Jul 19 '18 at 6:16






    Btw. I used your wording, but title and alt are actually attributes not a tags.

    – steros
    Jul 19 '18 at 6:16














    0














    You want to bring image_with_borders.phtml template file into your theme.



    https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml



    Then it's something like this



    <?php
    /**
    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */
    ?>
    <?php /** @var $block MagentoCatalogBlockProductImage */ ?>

    <span class="product-image-container"
    style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
    <span class="product-image-wrapper"
    style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
    <img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
    <?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
    src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
    max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
    max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
    alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>
    title="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
    </span>


    Uses image label. But that might be safer?



    But if you want product name try



    $block->getProduct()->getName();



    but if that doesnt work



    $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $product = $objectManager->get('MagentoFrameworkRegistry')->registry('product');
    $name = $product ? $product->getName() : null;


    Which isn't perfect but close enough.



    The better solution would be to modify MagentoCatalogBlockProductImage in an extension and then inject registry



    https://blog.qaisarsatti.com/magento_2/magento-2-get-current-product-information/






    share|improve this answer



























      0














      You want to bring image_with_borders.phtml template file into your theme.



      https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml



      Then it's something like this



      <?php
      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */
      ?>
      <?php /** @var $block MagentoCatalogBlockProductImage */ ?>

      <span class="product-image-container"
      style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
      <span class="product-image-wrapper"
      style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
      <img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
      <?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
      src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
      max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
      max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
      alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>
      title="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
      </span>


      Uses image label. But that might be safer?



      But if you want product name try



      $block->getProduct()->getName();



      but if that doesnt work



      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $product = $objectManager->get('MagentoFrameworkRegistry')->registry('product');
      $name = $product ? $product->getName() : null;


      Which isn't perfect but close enough.



      The better solution would be to modify MagentoCatalogBlockProductImage in an extension and then inject registry



      https://blog.qaisarsatti.com/magento_2/magento-2-get-current-product-information/






      share|improve this answer

























        0












        0








        0







        You want to bring image_with_borders.phtml template file into your theme.



        https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml



        Then it's something like this



        <?php
        /**
        * Copyright © Magento, Inc. All rights reserved.
        * See COPYING.txt for license details.
        */
        ?>
        <?php /** @var $block MagentoCatalogBlockProductImage */ ?>

        <span class="product-image-container"
        style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
        <span class="product-image-wrapper"
        style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
        <img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
        <?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
        src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
        max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
        max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
        alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>
        title="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
        </span>


        Uses image label. But that might be safer?



        But if you want product name try



        $block->getProduct()->getName();



        but if that doesnt work



        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $product = $objectManager->get('MagentoFrameworkRegistry')->registry('product');
        $name = $product ? $product->getName() : null;


        Which isn't perfect but close enough.



        The better solution would be to modify MagentoCatalogBlockProductImage in an extension and then inject registry



        https://blog.qaisarsatti.com/magento_2/magento-2-get-current-product-information/






        share|improve this answer













        You want to bring image_with_borders.phtml template file into your theme.



        https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml



        Then it's something like this



        <?php
        /**
        * Copyright © Magento, Inc. All rights reserved.
        * See COPYING.txt for license details.
        */
        ?>
        <?php /** @var $block MagentoCatalogBlockProductImage */ ?>

        <span class="product-image-container"
        style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
        <span class="product-image-wrapper"
        style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
        <img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
        <?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
        src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
        max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
        max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
        alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>
        title="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
        </span>


        Uses image label. But that might be safer?



        But if you want product name try



        $block->getProduct()->getName();



        but if that doesnt work



        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $product = $objectManager->get('MagentoFrameworkRegistry')->registry('product');
        $name = $product ? $product->getName() : null;


        Which isn't perfect but close enough.



        The better solution would be to modify MagentoCatalogBlockProductImage in an extension and then inject registry



        https://blog.qaisarsatti.com/magento_2/magento-2-get-current-product-information/







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 12 at 12:48









        Dominic XigenDominic Xigen

        1,7601311




        1,7601311



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f235066%2fmagento-2-how-to-add-title-tag-in-product-image-in-product-details-page%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?