Skip to content

A child module for Orchard Scripting Extensions for running JavaScript code inside Orchard.

License

Notifications You must be signed in to change notification settings

Lombiq/Orchard-Scripting-Extensions-JavaScript

Repository files navigation

Orchard Scripting Extensions: JavaScript

About

A child module for Orchard Scripting Extensions for running JavaScript code inside Orchard.

Documentation

This module depends on JavaScript.Net Orchard and Orchard Scripting Extensions. It uses many of the latter's features. Please install it first! (And also read that module's docs to see what you can do with it - and through it, with JavaScript). JavaScript execution goes through the excellent Javascript .NET library. Samples

var hello = "Hello JavaScript!"; 
hello; // The last statement will be the output of the script

// You can instantiate types that were loaded to the script context through the Factory object
var obj = Factory.Create("System.Object", null);
obj.ToString(); // Outputs "System.Object"

// There is an Orchard global variable that you can add fields to. By default it contains a WorkContext field with the Orchard WorkContext and an OrchardServices field with an IOrchardServices instance
Orchard.WorkContext.CurrentSite.SiteName;

// This adds the string "Hello!' to the markup of the layout's Body zone (this will just show up in the html source!).
Orchard.Layout.Get("Body").Add("Hello!"); 

Contributing and support

Bug reports, feature requests, comments, questions, code contributions, and love letters are warmly welcome, please do so via GitHub issues and pull requests. Please adhere to our open-source guidelines while doing so.

This project is developed by Lombiq Technologies. Commercial-grade support is available through Lombiq.

About

A child module for Orchard Scripting Extensions for running JavaScript code inside Orchard.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published