request.getAttribute in Sightly expression
I have a site where we're setting some request attributes that are used across the whole page via a JS-use file:
// requestAttributes.js
use(function(){
request.setAttribute('testAttribute","test attribute value");
});
And sightly markup that looks like this
<sly data-sly-use.atts="requestAttributes.js">
<html>
<sly data-sly-include="head.html" data-sly-unwrap/>
<sly data-sly-include="body.html" data-sly-unwrap/>
<sly data-sly-include="footer.html" data-sly-unwrap/>
</html>
</sly>
Is there a way to access the request attributes natively in Sightly (i.e. ${request.attributes["testAttribute"]})? I know that I could write a second js-use file to act as a getter for retrieving the attribute value, but ideally I'd like to do access it straight from the markup rather than having data-sly-use files in all of my include files.
Thanks!
