Home
Knitting
All Knitting
Knitting Needles
Buttons
Knitting Tools
Sock Blockers
Addi Knitting Products
Weaving
All Weaving
Loom Kits
Looms
Loom Tools
Kitchen
Garden
Desktop
Bespoke
{{shopper.order.total_VIEW}}
Order Number: {{shopper.orderNumber}}
Check Out
OpenForum
Extensions
InsertSourceFile
Inserts a files contents into the page
Parameters
pageName - The page where the file is attached (optional. default = current page name)
fileName - The file to insert
Usage:
[{InsertSourceFile pageName="/OpenForum/Extensions/InsertSourceFile" fileName="data.json"}]
//OpenForum/Extensions/InsertSourceFile/data.json
{ "pageName": "/OpenForum/Extensions/InsertSourceFile", "title": "InsertSourceFile", "pageParent": "https://open-forum.onestonesoup.org" }
//OpenForum/Extensions/InsertSourceFile/renderer.sjs
var sourcePageName = extension.getAttribute("pageName"); if(sourcePageName===null) { sourcePageName = pageName; } var fileName = extension.getAttribute("fileName"); var data = ""+file.getAttachment( sourcePageName,fileName ); data = data.replace(/(xmp)/g,"((xmp))"); var editLink = "/OpenForum/Editor?pageName="+sourcePageName+"&fileName="+fileName; pageData = "[/"+sourcePageName+"/"+fileName+"]
<(xmp) class=\"panel\">$contents$(xmp)>"; pageData = js.getObject("/OpenForum/Javascript/Renderer","DefaultRenderer.sjs").render(pageName,pageData); pageData = pageData.replace("$contents$",data); return pageData;
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×