Matrix Version: 5.4.1
On this manuals page under the heading “Creating Global Variables” …
<script runat="server">
//Global variables
var _siteSection = '%frontend_asset_url_path^explode:/^index:1^empty:home%';
var _pageType = '%frontend_asset_assetid^replace:{globals_site_assetid}|{globals_site_index_id}:H^eq:H:home:inside%';
var _pageLevel = %frontend_asset_url_path^explode:/^count^subtract:1%;
var _titleTag = '%frontend_asset_name^escapequotes% | %globals_site_name%';
</script>
Can we use the variables created here (like _siteSection) on some other page ? Are these really Global variables ? The heading is confusing me ?
What I am trying to do is pass an “id” to construct an endpoint in REST Resource asset ? The “id” is generated in a “server side JS code”.