Including a SSJS block in a Content Container Template Paint Layout like so:
<h1>Asset ID: %asset_assetid%</h1>
<h1> From pre-eval: <script runat="server">print('%asset_assetid%')</script></h1>
<h1> From SSJS: <script runat="server">print('%asset_assetid' + '%')</script></h1>
Ends up outputting two different asset IDs:
Asset ID: [ID of the Content Container]
From pre-eval: [ID of the Content Container]
From SSJS: [ID of the Standard Page that holds the Content Container]
This means that the keywords are evaluated before the SSJS run have one value, and the same keyword has a different value if printed out from the same SSJS block. The keywords should refer to the same 'asset' for consistency and reliability.
This inconsistency means you have to workaround the issue by using pre-evaluation of keywords to get SSJS to work; but this won't work everywhere.
Including a SSJS block in a Content Container Template Paint Layout like so:
Ends up outputting two different asset IDs:
This means that the keywords are evaluated before the SSJS run have one value, and the same keyword has a different value if printed out from the same SSJS block. The keywords should refer to the same 'asset' for consistency and reliability.
This inconsistency means you have to workaround the issue by using pre-evaluation of keywords to get SSJS to work; but this won't work everywhere.