The following block provides three separate properties:
- Embed Code: A text area that will be rendered in it's raw state on a razor file.
- Hosted CSS File: A content reference for an optimized production stylesheet file that has been uploaded to the CMS to be used by this block and rendered within the head element of the page.
Both of these methods come with additional overrides that allow you to define the name for the resource, it's dependencies and it's additional attributes. For example, the following call:
Will result in the follow script tag being rendered:
<script defer="defer" src="/globalassets/embeds/test.js"></script>
You can extend this same functionality to render externally hosted files with additional attributes, which could include cross origin and subresource integrity hashes like the following example
Which would then render like so:
<script crossorigin="anonymous" defer="defer" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" src="https://firstname.lastname@example.org/dist/js/bootstrap.bundle.min.js"></script>
- Ensure that Stylesheet resources are rendered correctly within the header
- Ensure that all resources are rendered uniquely
- Ensure that all resources are rendered with standard attributes for performance.