0

I want to add tag "noscript" in head.

 <head><noscript id="deferred-styles">
    <link  rel="stylesheet" type="text/css"  media="all" href="http://dev.magento2.com/magento2/pub/static/frontend/Magento/xtheme/en_US/mage/css1.css" />
    <link  rel="stylesheet" type="text/css"  media="all" href="http://dev.magento2.com/magento2/pub/static/frontend/Magento/xtheme/en_US/mage/css2.css" />          
</noscript></head> 

I have tried with below xml(default_head_blocks.xml) code but not working.

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configura`enter code here`tion.xsd">
<head>      
<noscript id="deferred-styles">
    <css src="css/css1.css" order="1" />
    <css src="font-awesome/css/css2.css" order="2" />
</noscript>     
</head>

1 Answer 1

3

You can add scripts from admin area.

Navigate Admin -> Content -> Design -> Configuration -> [your theme] -> HTML Head.

In this section you can add your scripts.

4
  • how can I forget this way ..(stupidity) :-( +1. Oct 29, 2018 at 11:03
  • Easiest way ;) Make a use of native M2 functionality :)
    – Greg
    Oct 29, 2018 at 11:05
  • but my few more css files are coming from another part then how to add tag for that. Oct 29, 2018 at 11:15
  • Whatever you add in there will be included before head closing tag in page HTML. So it will be included in all the pages.
    – Greg
    Oct 29, 2018 at 11:30

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.