I checked that cq:designPath is same in author and publish but when I am using ${currentStyle.path} to get the design path in author and publish then there is a slight difference i.e.
author:
/etc/designs/default/jcr:content/default-page/par-main/column-control/par-col-1/breadcrumb
publish:
/etc/designs/default/jcr:content/default-page/column-control/par-col-1/breadcrumb
I tried creating a new template with a new parsys say “par-main-1” but then “par-main-1” was missing in publisher.
I tried to resolve the issue by trying out the following.
Solved! Go to Solution.
Views
Replies
Total Likes
I am not sure if this is product bug or not but I solved this by removing one line of code from my template head.js .
I was inheriting my template from one of the "/libs" ( sightly) page and there head.js was having below line of code so I just overlayed head.js in my template and commented out below line of code.
if(wcmmode.disabled) {
request.setAttribute(Packages.com.day.cq.wcm.api.components.ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, true);
}
I commented out this and every thing was back to normal.
Check your template and check if you have this code some where .
Views
Replies
Total Likes
I am also facing same issue in currentStyle object in publish. My component is not using parsys and it is a cq include in page
publish ,value of currentStyle is like :/etc/designs/scholastic/campaign/email/jcr:content/reading-club-page
while on author it is like /etc/designs/scholastic/campaign/email/jcr:content/reading-club-page/header-container/preheaderimage. .
I tried all steps given here but could not resolve this .
Is there a known solution for this ?
Views
Replies
Total Likes
Note : Happens only if you are using this in sightly based templates.
Views
Replies
Total Likes
Does this happen when you use JSP as opposed to Sightly?
Views
Replies
Total Likes
Yes.
Views
Replies
Total Likes
I haven't tried this with jsp but I'm doing something similar in Sightly/ javascript and encountering the same issue. I've had to resort to something similar to the above comments : in preview/ publish mode fetch the design values via currentDesign.getJSON(), parse the value returned from that and then key into the values I want from the Json object.
Is this confirmed as a bug or an issue? Or should I be coding something differently for publish mode...
// ...wcm use javascript snippet var n, p; if(wcmmode == 'EDIT' || wcmmode == 'DESIGN'){ n = currentStyle.get("foo"); p = currentStyle.get("bar"); }else{ // n = currentStyle.get("foo"); // p = currentStyle.get("bar"); ...these method calls return null - what to do here? }
Views
Replies
Total Likes
I am not sure if this is product bug or not but I solved this by removing one line of code from my template head.js .
I was inheriting my template from one of the "/libs" ( sightly) page and there head.js was having below line of code so I just overlayed head.js in my template and commented out below line of code.
if(wcmmode.disabled) {
request.setAttribute(Packages.com.day.cq.wcm.api.components.ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, true);
}
I commented out this and every thing was back to normal.
Check your template and check if you have this code some where .
Views
Replies
Total Likes
Thanks Purnendra,
Actually my page is built with jsps (resource super type, foundation/components/page), perhaps the init scripts, global jsp etc do something similar to the code in head.js for page templates built in sightly? I'll take a look.
Views
Replies
Total Likes
Hi,
Any updates on this issue. I am also facing the same issue in AEM 6.1 in sightly ?
Views
Replies
Total Likes
Sorry Promilag - no update from me. I didn't follow the solution marked above as my page templates are built with jsp, so i left the sightly js using currentDesign.getJSON() to get the required values.
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies