I have created a custom cms page layout and I need to add css and js only for this layout.
I tried below tutorial but I am getting fatal error when I click 'Insert widget' from admin->cms page editor->insert widget.
You can add your CSS and JS file name here in the head.
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> <head> <css src="VendoreName_CustomLayout::css/file.css" /> <script src="VendoreName_CustomLayout::js/file.js" /> </head> </page>
@Sanjay JethvaI need to add the css and js only in custom CMS Page layout not globally. I think the above xml will add the css and js in globally which means all pages.