I have prepared one module in which I have prepared two .phtml files and included css and js through module layout file. Now, I want to include those .phtml file in different blocks and pages.
I have tried to include .phtml in CMS page with below code:
{{block class="CompanyName\ModuleName\Block\BlockName" template="CompanyName_ModuleName::file.phtml"}}
But it only includes .phtml file not CSS.
Here is my module layout file:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
<head>
<css src="CompanyName_ModuleName::css/abc.css"/>
<css src="CompanyName_ModuleName::css/instapic-slider.css"/>
</head>
<body>
<referenceContainer name="content">
<block class="CompanyName\ModuleName\Block\BlockName" name="ModuleName_bytag" template="picsbytag.phtml" />
<block class="CompanyName\ModuleName\Block\BlockName" name="ModuleName_byname" template="picsbyname.phtml" />
</referenceContainer>
</body>
</page>
How I can achieve this to include css with .phtml file.
Any help will be appreciated.