Similar to this question is there a way to use ifconfig to conditionally add script,meta, or css assets within the portion of a layout.xml file:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head name="bizgenius.scripts">
<meta ifconfig="newsletter/general/active" name="some-meta-tag" content=""></meta>
<script ifconfig="newsletter/general/active" src="somescript.js" src_type="url" />
</head>
</page>
The above block seems to throw an error “The attribute ‘ifconfig’ is not allowed”. Any alternative solutions appreciated.