0
votes

I am using sightly to access the design dialog properties for a component. something like

<span data-sly-test="${currentStyle.delimiter}">${currentStyle.delimiter}</span>

but all I am getting is an empty string.

I tried to resolve the issue by trying out the following.

  1. Activating the design node
  2. Deleting the page and creating a new page.
  3. Deleting components and dragging and dropping the component again on the page.
  4. I checked the JSON output of currentDesign and all the values am trying to access are available there.
1
Did you check if the author and publish are pointing to / fetching from the same design?rakhi4110
how can i ensure this?amitdeol
Generally, the design for a site is set in the homepage page. You should find a cq:designPath property in the homepage jcr:content node. In case the design path is not mentioned, then it would be /etc/designs/default. You can also check using ${currentStyle.path} to check the path of your currentStylerakhi4110
i checked that cq:designPath is same in author and publish but when i am using ${currentStyle.path} to get the path in author and publish then there is a slight difference i.e. author: /etc/designs/corporate/global/<appname>/jcr:content/page/par-main/column-control/par-col-1/<componentname> publish: /etc/designs/corporate/global/<appname>/jcr:content/page/column-control/par-col-1/<componentname>amitdeol
More over design properties are getting stored at /etc/designs/corporate/global/<appname>/jcr:content/page/par-main/column-contro‌​l/par-col-1/<componentname> only for both the instances.amitdeol

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 was back to normal.