0

This is my first attempt to write a Module for Magento 2.1 I have read the documentation for referenceContainer that is not very helpful,

I would like to know how can I access and apply my change in a specific div in my template, following is the code of template of another module where I would like to inject my code

<div class="columns">
  <div class="column main"> 

    <div class="wk-mp-design">
      <div class="wk-mp-design-inner wk-mp-design-inner-last">
        <div class="wk-mp-profile-container storename">
          <div class="store-name">About Store</div>
        </div>
        <span class="data"></span>
        <div class="wk-mp-profile-container storename wk-mp-display-block-css">
          <div class="store-name">On the Social Web</div>
        </div>
      </div>
    </div>

I would Like to add the information beneath <div class="store-name">About Store</div> or with in <span class="data"></span> or above <span class="data"></span> what ever is doable for now

I have following xml in layout for this injection

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/e$
    <body>
        <referenceContainer name="content">
            <block class="App\Helloworld\Block\Helloworld" name="helloworld" template="helloworld.phtml" />
        </referenceContainer>
    </body>
</page>

now with name="content" it injects the html right before the end of <div class="column main"> how do I identify the correct container to inject html using referenceContainer

  • Where you need to add those content ?Do you need to ad in footer? – aravind Mar 8 '18 at 7:09
  • If you see the html in my question above, I want to see the content below <div class="store-name">About Store</div> line – riksof-zeeshan Mar 8 '18 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.