0

i want to make a module which will add a custom meta tag which will be dynamic as per page .it will appear in all page. enter image description here

i want this to be appear after meta name "viewreport".

0

I am not sure about add meta after meta name "viewreport", But you can add dynamic like adding below code into default.xml

<referenceContainer name="after.body.start">
    <block class="Magento\Framework\View\Element\Template" name="test" template="test.phtml" after="-"/>            
</referenceContainer>

OR

<referenceContainer name="before.body.end">
    <block class="Magento\Framework\View\Element\Template" name="test" template="test.phtml" after="-"/>
</referenceContainer>

OR

<referenceBlock name="head.additional">
    <block class="Magento\Framework\View\Element\Template" name="test" template="test.phtml" after="-"/>
</referenceBlock> 

Thanks

1
  • thanks.i have used "head.additional" but it placing my tag at the last of head but i want to add a meta tag though phtml at upper portion like before or after meta keyword,description, etc. – Shubhajay Das Dec 3 '18 at 7:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.