Module for Orchard Core that allows you to specify custom script blocks for the <head>
or at the bottom of the page. Useful for adding third party integrations (e.g. Google Analytics).
This module is referencing a stable build of Orchard Core (1.8.3
).
This module is available on NuGet. Add a reference to your Orchard Core web project via the NuGet package manager. Search for "Etch.OrchardCore.InjectScripts", ensuring include prereleases is checked.
Alternatively you can download the source or clone the repository to your local machine. Add the project to your solution that contains an Orchard Core project and add a reference to Etch.OrchardCore.InjectScripts.
Enable the "Inject Scripts" feature, which will make a new "Scripts" option available under the "Configuration" option in the admin dashboard menu. Within the "Scripts" section, authorised content editors can define JavaScript that will be rendered either in the <head>
section or at the foot of the page. If the JavaScript is not rendered on the page, ensure the following snippets are in the layout.liquid
template for your theme.
{% resources type: "HeadScript" %}
{% resources type: "FootScript" %}