Load scripts with a #hash in Core.
Install module
npm install @abcnews/hash-scripts-loaderPut in code
import loadScripts from "@abcnews/hash-scripts-loader";
loadScripts();Put something like #interactivescriptsENCODEDldhgjldkjg3lk43nlkjbnsdlkfn in a CoreMedia article. With the encoded string being a base-36-props string. Use the base 36 converter to get the string.
Use the following pattern.
{"scripts": ["https://path.to.your.com/script.js"]}Multiple scripts supported. eg.
{
"scripts": [
"https://path.to.your.com/script.js",
"https://path.to.another.com/script.js"
]
}When using the preview site you can proxy a local script using proxy and proxyencoded query strings.
?proxy=https://ws204914.aus.aunty.abc.net.au:8000/index.jsseems to work only onhttps://master-news-web.news-web-preview.presentation-layer.abc-prod.net.audomain NOT nucwed?proxyencoded=5flhz4us1jwv2ryyloaj9zytj0scx2zv3at3b2mgy8p2gnwf1xw1araikd8atfti1h6hfse65289hftsamn2oco3e5tcin6trz542ef1with the encoded string something like the following (works in nucwed preview):
{ "scripts": ["https://ws246352.aus.aunty.abc.net.au:8000/index.js"] }
Use this base36 encoding tool to get the string.
Attach this standalone JavaScript file to your CoreMedia article to use this loader in Presentation Layer.
To do this, create a new JavaScript document and paste the URL into the URL field and check it in. Then attach the JS document in your article.
https://www.abc.net.au/res/sites/news-projects/interactive-loader/1.1.2/index.js
Note: Currently only works if Odyssey PL JS is also attached to the article