Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hi,
i need to hidden a div when the user clicks on the lens (preview mode).
I can't use the WCMMode.EDIT variable why the page isn't refreshed.
It seems also that doesn't exist a particular class to add to the div.
How can i do?
Thanks
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
As @lokesh suggested add below code in your init.jsp
CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", { propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>, adminUrl: "/siteadmin", previewReload: "true" });
In Sightly:
<div data-sly-test="${wcmmode.edit}">Show this only in edit mode to the author</div>
In JSTL- JSP
<% request.setAttribute("currentMode", WCMMode.fromRequest(request)); request.setAttribute("editMode", WCMMode.EDIT); %> <c:if test="${currentMode ne editMode}"> <c:set var ="style" value = "style=\"display:none\"" /> </c:if> <div ${style}> Here is you DIV </div>
Visualizações
respostas
Total de curtidas
Refer [1] to reload the page when you switch the modes. After this change, as the page reloads, you can try adding your logic on preview mode.
[1] https://helpx.adobe.com/experience-manager/kb/ReloadOnWCMModeSwitch.html
Visualizações
respostas
Total de curtidas
As @lokesh suggested add below code in your init.jsp
CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", { propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>, adminUrl: "/siteadmin", previewReload: "true" });
In Sightly:
<div data-sly-test="${wcmmode.edit}">Show this only in edit mode to the author</div>
In JSTL- JSP
<% request.setAttribute("currentMode", WCMMode.fromRequest(request)); request.setAttribute("editMode", WCMMode.EDIT); %> <c:if test="${currentMode ne editMode}"> <c:set var ="style" value = "style=\"display:none\"" /> </c:if> <div ${style}> Here is you DIV </div>
Visualizações
respostas
Total de curtidas
Thanks, i have seen this document but i can't modify the libs.
I'm trying to solve this problem with js and the click function.
$(document).on ("click", ".cq-sidekick-preview", function (e) { e.stopImmediatePropagation(); alert("click1"); }); $(document).on ("click", ".x-tool-toggle", function (e) { e.stopImmediatePropagation(); alert("click2"); });
The first function works correctly and show the alert when the user click on the lens.
The second function doesn't work why the event is blocked from another function of cq5.
I'm trying to add a container to the x-tool-toggle and add a function on it.
$(document).ready(function() { alert("id"+$( ".x-tool-toggle" ).attr('id')); $( ".x-tool-toggle" ).wrap( "<div class='clickContainer'></div>" ); });
The id isn't defined so i'm trying the use the function load of jquery but:
$(document).load(function() { alert("function called"); });
I can't see the alert, why?
Visualizações
respostas
Total de curtidas
The document load doesn't work but works the window load.
The alert of the window load has an id undefined. How can i wait the loading of the popup?
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas