Expand my Community achievements bar.

AEM 6.1 || currentStyle.<propertyName> is returning null in cq5 publisher

Avatar

Level 2

I am using currentStyle Object to fetch the design dialog properties for a component.

${currentStyle.linkurl}

This is working fine in author but returning null in publisher. I have already seen the below given post, but no solution has been posted. Is anyone has come across any solution for this?

currentStyle.<propertyName> is returning null in cq5 publisher, which is working perfectly fine in a... (I did post a comment but looks like this post has been marked for deletion)

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

2 Replies

Avatar

Administrator

Please refer to following links for some help:-

Link:- http://stackoverflow.com/questions/30122158/currentstyle-propertyname-is-returning-null-in-cq5-publi...

//

  1. In preview/ publish mode fetch the design values via currentDesign.getJSON(), parse the value returned from that and then key into the values You want from the Json object.
  2. You may solve this by removing one line of code from your template head.js. if you are inheriting any template from one of the "/libs" ( sightly) page and there head.js will be having below line of code so you can just overlay head.js in your 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); }

Comment out this and everything was back to normal.

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Community Advisor
Check for the design nodes are properly replicated in publish