@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
Await system scripts This page waits for... <!-- unimportant stuff, hidden -->
<!-- unimportant stuff, hidden -->
@{
// Use the PageService to activate turnOn and a system script
Kit.Page.Activate("turnOn", "fancybox4");
// Create unique DOM attribute with Module Id
var uniqueDomAttrubute = "turn-on-example-" + CmsContext.Module.Id;
}
@* Inject attribute into DIV, to make it accessible for query *@
<a @uniqueDomAttrubute href='https://images.unsplash.com/photo-1503899036084-c55cdd92da26?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80' data-caption="System script used here">
<img loading="lazy" class="img-fluid" src='https://images.unsplash.com/photo-1503899036084-c55cdd92da26?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=250&q=80'/>
</a>
@*
Wait for the system script to load,
then execute the window.turnOnTutorial202.init function
and pass the domAttribute as JSON
*@
<turnOn turn-on='{
"await": ["window.Fancybox"],
"run": "window.turnOnTutorial202.init()",
"data": { "domAttribute": "@uniqueDomAttrubute" } }'></turnOn>
@* Include local JavaScript file *@
<script src="@App.Path/turn-on/_202-system scripts.js"></script>
<!-- unimportant stuff, hidden -->