Hi All,
I am using conditional comment to check browser version.
Is there a way to check wcmmode of the instance in conditional comments?
I want to show the message in author/edit mode.
Following is my piece of code in component:
<!--[if lt IE 9]>
<div class="upgrade-browser-banner" role="alert">
<h4>upgrade your browser message</h4>
</div>
<![endif]-->
i tried the following but it's not working:
<!--[if (lt IE 9) | (WCMmode.edit) ]>
Please Help.
Solved! Go to Solution.
Views
Replies
Total Likes
do something like this
<sly data-sly-test="${wcmmode.edit}">
your stuff
</sly>
Views
Replies
Total Likes
I dont think you can check it inside the conditional comment. The check should work if you do it in body of condition...
Views
Replies
Total Likes
I want it to be available in author mode to be edited even if the browser satisfies the condition in 'if' block.
Views
Replies
Total Likes
Ok. understood... then one thing you can probably do is to have this conditional comment inside WCMmode.edit.. i mean just the if line and end-if line
Views
Replies
Total Likes
I tried that but if the browser is above IE 9, its not allowing authors to edit the component.
Views
Replies
Total Likes
I dont have IE browser but I tested it on non IE and it works...
<%if(WCMMode.fromRequest(request) != WCMMode.EDIT){%>
<!--[if lt IE 9]>
<%}%>
<div class="upgrade-browser-banner" role="alert">
<cq:include path="alertMessage" resourceType="foundation/components/text"/>
</div>
<%if(WCMMode.fromRequest(request) == WCMMode.EDIT){%>
<![endif]-->
<%}%>
Views
Replies
Total Likes
I am using AEM 6.3.
As per client standards, we cannot use scriplets in html files.
Views
Replies
Total Likes
HTL counterpart of this would have same impact I believe:
<div data-sly-test="${wcmmode.edit}">
Views
Replies
Total Likes
do something like this
<sly data-sly-test="${wcmmode.edit}">
your stuff
</sly>
Views
Replies
Total Likes
Hi,
As fieke suggest please use data-sly-test to check the different mode.
please check this link:
htl-spec/SPECIFICATION.md at master · Adobe-Marketing-Cloud/htl-spec · GitHub
Regards,
Prince
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies