Hi @v1101,
Here is what you can do:
A. If the run mode that you are setting is STATIC, you can create a new string variable in the sling model and access it in HTL.
Java:
private String runMode;
HTL:
<div data-sly-test.runMode="${object.runMode}">
Also, you can let author select the value via dialog.
You can also get it via slingSettingsService object:
slingSettingsService.getRunModes();
B. In sling models request attribute can be set using the request object.
Set the model adaptable to SlingHttpServletRequest
@Model(adaptables = SlingHttpServletRequest.class)
Inject the request:
@Inject
SlingHttpServletRequest request;
Using this request attribute, you can set the value in any attribute you need and send it to HTL.
C. The pageContext object can be used to set, get or remove the attribute from the page, request, session, application.
You can set the context in sightly like this :
${properties.nodename @ context='html'}
Not sure why you need pageContext here, but here is the list of available global objects in HTL: https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/global-objects.html?lang=en...
Thanks,
Kiran Vedantam.