Source Code Assets
Create NewLink to this section
- Navigate to Content > Assets.
- Click the green +New button.
- Select "Source Code."
- An asset name is required. Description and tags are optional, but tags can make it easier to find when searching for an asset to place on a page. Checking "Lock to site" means the asset can only be used in the site where it was created.
- Set access settings for the asset if desired.
- Write the asset content in the mini-source code editor.
- Click Create to make the asset.
Your asset is now available for use on pages, but must be published before it appears on any live web pages.
While technically any kind of code can be entered into a source code asset, remember that the code is inserted into the page on publish. Therefore, it must be valid XML, or the page won't render correctly.
Note: Boolean attributes, or attributes that don't have a value assigned, are not valid XML. For these attribute types, add the attribute name as the value, e.g.,
<script async></script> should be written as
<script async="async"></script>. All "&" must be encoded as well.
A common use for source code assets is inserting a news or events feed into a page.