I have a macro ("Macro A") on one page that is running some javascript and creating some html.
That page is then included using the "Page Include" macro.
Is there a way, inside Macro A, to determine that it is inside the Page Include macro?
And then alter (in this case, disable some of the javascript and html) what Macro A is generating?
Currently, i'm using the AJS.toInit and searching for the "include" tag in the parent html. This doesn't work as nicely as detecting it ahead of time, because i have to retroactively disable javascript or "display:none" html.
<script type="text/javascript">
var $pageIncluded = false;
AJS.toInit(function(){
a = document.getElementById("macro-a-content");
b = a.closest("[data-macro-name='include']")
if(b){
$pageIncluded = true;
}
)}
</script>