How do I add a custom message block at the beginning of the maincontent div in product list/ detail page ...

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

Text adventure game code

How to start emacs in "nothing" mode (`fundamental-mode`)

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

Increase performance creating Mandelbrot set in python

How long to clear the 'suck zone' of a turbofan after start is initiated?

Unreliable Magic - Is it worth it?

Need some help with wall behind rangetop

Why do remote companies require working in the US?

What do "high sea" and "carry" mean in this sentence?

How do I go from 300 unfinished/half written blog posts, to published posts?

What is the difference between "behavior" and "behaviour"?

How to Reset Passwords on Multiple Websites Easily?

How do scammers retract money, while you can’t?

How do spells that require an ability check vs. the caster's spell save DC work?

Can a single photon have an energy density?

Should I tutor a student who I know has cheated on their homework?

How to write papers efficiently when English isn't my first language?

Anatomically Correct Mesopelagic Aves

How to be diplomatic in refusing to write code that breaches the privacy of our users

Why do professional authors make "consistency" mistakes? And how to avoid them?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

WOW air has ceased operation, can I get my tickets refunded?

What does "Its cash flow is deeply negative" mean?



How do I add a custom message block at the beginning of the maincontent div in product list/ detail page



The Next CEO of Stack Overflowcalling sidebar for product detail page onlycalling cms static block on product detail pageAdd Video or some custom block below media on product detail pageadd custom block just below media view more on product detail pageadd phtml page block before additional block on product detail pageCheckout Page List Item Add Custom AttributeHow add div after image block in Magento 2?Magento 2 How to add Magnifier to product list page?How to load custom template file for product detail page in magento2Magento2: How can call custom block after product title via xml in product list page?












0















How do I add a custom message block "Lorem Ipsum dolor sit amet" at the beginning of the "maincontent" div that appear below the breadcrumbs in product list/ detail page.










share|improve this question

























  • If it works for you than give up vote and accept answer to help others as well.!!

    – Vivek
    Dec 17 '18 at 8:23
















0















How do I add a custom message block "Lorem Ipsum dolor sit amet" at the beginning of the "maincontent" div that appear below the breadcrumbs in product list/ detail page.










share|improve this question

























  • If it works for you than give up vote and accept answer to help others as well.!!

    – Vivek
    Dec 17 '18 at 8:23














0












0








0








How do I add a custom message block "Lorem Ipsum dolor sit amet" at the beginning of the "maincontent" div that appear below the breadcrumbs in product list/ detail page.










share|improve this question
















How do I add a custom message block "Lorem Ipsum dolor sit amet" at the beginning of the "maincontent" div that appear below the breadcrumbs in product list/ detail page.







magento2 product






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 14 mins ago









Teja Bhagavan Kollepara

3,01241949




3,01241949










asked Dec 17 '18 at 5:45









ShamiShami

276




276













  • If it works for you than give up vote and accept answer to help others as well.!!

    – Vivek
    Dec 17 '18 at 8:23



















  • If it works for you than give up vote and accept answer to help others as well.!!

    – Vivek
    Dec 17 '18 at 8:23

















If it works for you than give up vote and accept answer to help others as well.!!

– Vivek
Dec 17 '18 at 8:23





If it works for you than give up vote and accept answer to help others as well.!!

– Vivek
Dec 17 '18 at 8:23










2 Answers
2






active

oldest

votes


















0














You can add an extra block by override breadcrumbs.phtml. Copy breadcrumbs.phtml in from vendor/magento/module-catalog/view/frontend/templates/product/breadcrumbs.phtml to app/design/frontend/<CompanyNmae.>/<themename>/Magento_Catalog/templates/breadcrumbs.phtml. Then call a static block bottom of breadcrumbs.phtml.



you have to change **static-block-id**


<div class ="static block" style="bottom: 127px; position: absolute;">
<?php echo $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('static-block-id')->toHtml(); ?>
</div>





share|improve this answer































    0














    You can create catalog_product_view.xml file to your theme under Magento_Catalog/layout/



    Create test.phtml file at your theme under Magento_Catalog/product/view/test.phtml



    Than add below code:



    <referenceContainer name="page.messages">
    <container name="product.info.afterprice" after="breadcrumbs" label="Product info afterprice" htmlTag="div" htmlClass="product-info-after-price">
    <block class="MagentoCatalogBlockProductView"
    name="product.info.enquiry"
    after="breadcrumbs"
    template="Magento_Catalog::product/view/test.phtml">
    </block>
    </container>
    </referenceContainer>


    Flush cache and check. Magic will be there !!!



    Update :



    To implement at category page you need to create file catalog_category_view.xml at same path as catalog_product_view.xml and paste above code.






    share|improve this answer


























    • Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

      – Shami
      Dec 17 '18 at 7:27












    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%2f254824%2fhow-do-i-add-a-custom-message-block-at-the-beginning-of-the-maincontent-div-in-p%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














    You can add an extra block by override breadcrumbs.phtml. Copy breadcrumbs.phtml in from vendor/magento/module-catalog/view/frontend/templates/product/breadcrumbs.phtml to app/design/frontend/<CompanyNmae.>/<themename>/Magento_Catalog/templates/breadcrumbs.phtml. Then call a static block bottom of breadcrumbs.phtml.



    you have to change **static-block-id**


    <div class ="static block" style="bottom: 127px; position: absolute;">
    <?php echo $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('static-block-id')->toHtml(); ?>
    </div>





    share|improve this answer




























      0














      You can add an extra block by override breadcrumbs.phtml. Copy breadcrumbs.phtml in from vendor/magento/module-catalog/view/frontend/templates/product/breadcrumbs.phtml to app/design/frontend/<CompanyNmae.>/<themename>/Magento_Catalog/templates/breadcrumbs.phtml. Then call a static block bottom of breadcrumbs.phtml.



      you have to change **static-block-id**


      <div class ="static block" style="bottom: 127px; position: absolute;">
      <?php echo $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('static-block-id')->toHtml(); ?>
      </div>





      share|improve this answer


























        0












        0








        0







        You can add an extra block by override breadcrumbs.phtml. Copy breadcrumbs.phtml in from vendor/magento/module-catalog/view/frontend/templates/product/breadcrumbs.phtml to app/design/frontend/<CompanyNmae.>/<themename>/Magento_Catalog/templates/breadcrumbs.phtml. Then call a static block bottom of breadcrumbs.phtml.



        you have to change **static-block-id**


        <div class ="static block" style="bottom: 127px; position: absolute;">
        <?php echo $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('static-block-id')->toHtml(); ?>
        </div>





        share|improve this answer













        You can add an extra block by override breadcrumbs.phtml. Copy breadcrumbs.phtml in from vendor/magento/module-catalog/view/frontend/templates/product/breadcrumbs.phtml to app/design/frontend/<CompanyNmae.>/<themename>/Magento_Catalog/templates/breadcrumbs.phtml. Then call a static block bottom of breadcrumbs.phtml.



        you have to change **static-block-id**


        <div class ="static block" style="bottom: 127px; position: absolute;">
        <?php echo $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('static-block-id')->toHtml(); ?>
        </div>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 17 '18 at 6:07









        Supravat MSupravat M

        1,14611626




        1,14611626

























            0














            You can create catalog_product_view.xml file to your theme under Magento_Catalog/layout/



            Create test.phtml file at your theme under Magento_Catalog/product/view/test.phtml



            Than add below code:



            <referenceContainer name="page.messages">
            <container name="product.info.afterprice" after="breadcrumbs" label="Product info afterprice" htmlTag="div" htmlClass="product-info-after-price">
            <block class="MagentoCatalogBlockProductView"
            name="product.info.enquiry"
            after="breadcrumbs"
            template="Magento_Catalog::product/view/test.phtml">
            </block>
            </container>
            </referenceContainer>


            Flush cache and check. Magic will be there !!!



            Update :



            To implement at category page you need to create file catalog_category_view.xml at same path as catalog_product_view.xml and paste above code.






            share|improve this answer


























            • Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

              – Shami
              Dec 17 '18 at 7:27
















            0














            You can create catalog_product_view.xml file to your theme under Magento_Catalog/layout/



            Create test.phtml file at your theme under Magento_Catalog/product/view/test.phtml



            Than add below code:



            <referenceContainer name="page.messages">
            <container name="product.info.afterprice" after="breadcrumbs" label="Product info afterprice" htmlTag="div" htmlClass="product-info-after-price">
            <block class="MagentoCatalogBlockProductView"
            name="product.info.enquiry"
            after="breadcrumbs"
            template="Magento_Catalog::product/view/test.phtml">
            </block>
            </container>
            </referenceContainer>


            Flush cache and check. Magic will be there !!!



            Update :



            To implement at category page you need to create file catalog_category_view.xml at same path as catalog_product_view.xml and paste above code.






            share|improve this answer


























            • Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

              – Shami
              Dec 17 '18 at 7:27














            0












            0








            0







            You can create catalog_product_view.xml file to your theme under Magento_Catalog/layout/



            Create test.phtml file at your theme under Magento_Catalog/product/view/test.phtml



            Than add below code:



            <referenceContainer name="page.messages">
            <container name="product.info.afterprice" after="breadcrumbs" label="Product info afterprice" htmlTag="div" htmlClass="product-info-after-price">
            <block class="MagentoCatalogBlockProductView"
            name="product.info.enquiry"
            after="breadcrumbs"
            template="Magento_Catalog::product/view/test.phtml">
            </block>
            </container>
            </referenceContainer>


            Flush cache and check. Magic will be there !!!



            Update :



            To implement at category page you need to create file catalog_category_view.xml at same path as catalog_product_view.xml and paste above code.






            share|improve this answer















            You can create catalog_product_view.xml file to your theme under Magento_Catalog/layout/



            Create test.phtml file at your theme under Magento_Catalog/product/view/test.phtml



            Than add below code:



            <referenceContainer name="page.messages">
            <container name="product.info.afterprice" after="breadcrumbs" label="Product info afterprice" htmlTag="div" htmlClass="product-info-after-price">
            <block class="MagentoCatalogBlockProductView"
            name="product.info.enquiry"
            after="breadcrumbs"
            template="Magento_Catalog::product/view/test.phtml">
            </block>
            </container>
            </referenceContainer>


            Flush cache and check. Magic will be there !!!



            Update :



            To implement at category page you need to create file catalog_category_view.xml at same path as catalog_product_view.xml and paste above code.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 17 '18 at 7:30

























            answered Dec 17 '18 at 6:13









            VivekVivek

            1,470631




            1,470631













            • Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

              – Shami
              Dec 17 '18 at 7:27



















            • Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

              – Shami
              Dec 17 '18 at 7:27

















            Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

            – Shami
            Dec 17 '18 at 7:27





            Hey @Web Developer this works fine. But the message appears only on product detail page. I need it on product list page too.

            – Shami
            Dec 17 '18 at 7:27


















            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%2f254824%2fhow-do-i-add-a-custom-message-block-at-the-beginning-of-the-maincontent-div-in-p%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

            “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

            How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

            變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...