0
votes

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 author (I did post a comment but looks like this post has been marked for deletion)

Discussion on Adobe forum

1
Has the design node (/etc/designs/<your_app_name>) been replicated to publish?Bruce Lefebvre
Yes, i have replicated. Still it is showing null.user3451326
Its working fine now after design replication. There was some caching issue.user3451326

1 Answers

0
votes

You have two options

  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 will work for you.