내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

why pushed button in the sidekick don't display sometimes?

Avatar

이전 커뮤니티 멤버

Hi there,

I add following JS code under the folder apps\myApp\clientlib

CQ.Ext.ns("MyClientLib"); MyClientLib.ContentFinder = { addToCart: function(sk){ var pagePanel = sk.panels["PAGE"]; var button = pagePanel.findBy(function(comp){ return comp["name"] == "ADD2_CART"; }, pagePanel); if(button && button.length > 0){ return; } button = { xtype: "button", scope: sk, name: "ADD2_CART", text: "Add to cart", "context": [ CQ.wcm.Sidekick.PAGE ], handler: function(){ //store to cart var pagePath = CQ.WCM.getPagePath(); var params = {"nodePath": pagePath}; CQ.shared.HTTP.post("/bin/mySearchServlet", function(options, success, response) { if (!success) { CQ.Ext.Msg.alert( CQ.I18n.getMessage("Error"), CQ.I18n.getMessage("Could not add current page to cart.")); } else { CQ.Ext.Msg.alert("Success","Current page has been added to the cart."); } },params); } }; pagePanel.insert(10,button); sk.actns.push(button); } }; (function(){ var result; var ipAddress; CQ.Ext.Ajax.request({ url: CQ.HTTP.externalize("/bin/customer"), method: "GET", success: function(response) { var info = CQ.Ext.util.JSON.decode(response.responseText); var ack = info[0].result; var ip = info[1].ipAddress; result = ack; ipAddress = ip; }, failure: function(response) { } }); var c = MyClientLib.ContentFinder; if( ( window.location.pathname == "/cf" ) || ( window.location.pathname.indexOf("/content") == 0)){ var SK_INTERVAL = setInterval(function(){ var sk = CQ.WCM.getSidekick(); if(sk){ clearInterval(SK_INTERVAL); c.addToCart(sk); } }, 250); } })();

Then i begin test that in the website Geometrixx Demo Site, it is okey. But found the weird point is if i enter website Geometrixx Mobile Demo Site, the sidekick don't display the new button in another laptop.

Also i notice it is okey for Firefox browser except IE and chrome.

Anybody know how to deal with this problem to make sure the new button display in the sidekick on all browser..

 

Thanks a lot.

 

Best regards,

Brian

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

It could be because,In Geometrix site, they have included <cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext"/> in the body.jsp and it might not have been included in Geometrix Mobile Site

원본 게시물의 솔루션 보기

5 답변 개

Avatar

Level 10

Is it on a specific browser or on all browsers ?

Avatar

이전 커뮤니티 멤버

Seems like FireFox is okay but IE and Chrome are not.  Interesting…

Avatar

Level 10

In Chrome and IE, do you see any JS error ?

Avatar

이전 커뮤니티 멤버

No find JS error but find server error log:

31.03.2015 15:14:54.744 *ERROR* [10.10.215.29 [1427786094713] GET /content/geometrixx_mobile/en/products.feature.html HTTP/1.1] org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource SyntheticResource, type=cq/personalization/components/contextcloud, path=/content/geometrixx_mobile/en/products/jcr:content/contextcloud

Avatar

정확한 답변 작성자:
Level 10

It could be because,In Geometrix site, they have included <cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext"/> in the body.jsp and it might not have been included in Geometrix Mobile Site