Expand my Community achievements bar.

SOLVED

design cell path discrepancy between design_dialog and currentStyle.getPath

Avatar

Level 2

CQ 5.6.1 - In a nutshell, the design cell path generated by a component's design_dialog doesn't match the component's "currentStyle.getPath()".  This makes retrieving properties,via...

currentStyle.get(String name, T defaultValue)

...always return the default value.

I'm trying to figure out if this problem is a conceptual misunderstanding on my part, or a result of how I've set up my hierarchy, or a problem elsewhere.

I have a component statically referenced on my page component with:

<cq:include path="quick-links" resourceType="company/components/menus/quick-links" />

In this "quick-links" component, I have two additional component references:

<cq:include path="quick-links-title" resourceType="company/components/heading" /> <cq:include path="quick-links-parsys" resourceType="company/components/parsys" />

Inside "quick-links-parsys", I permit a component called "quick-links-button".  This component has a design_dialog that lets the user establish a path to a library of icons for that particular type of button.

When I visit the design_dialog and enter a value, it gets written to:

/etc/designs/company/jcr:content/mypage/quicks-links/quick-links-parsys/quick-link-button@icon-library-path = "/path/to/icons"

...which fits my current understanding of how things work.

However, when I try retrieve this value in the quick-link-button component with:

<%=currentStyle.get("icon-library-path", "unset")%>

I alway get back "unset".  When I echo currentStyle.getPath() I get this back:

/etc/designs/company/jcr:content/mypage/quick-links-parsys/quick-link-button

...which is different than where I'm expecting, and explains why my property always comes back as unset. The "/quick-links/" part in "/etc/designs/company/jcr:content/mypage/quick-links/quick-links-parsys/quick-link-button" is missing.

What's going on here? Is this expected?  The design dialog is forming the cell path one way and currentStyle is resolving it another.  Can I correct this?  The KB entry at http://helpx.adobe.com/experience-manager/kb/DesigneCellId.html didn't really help me at all, but I don't *think* it applies.  Why is the "/quick-links/" part of the path missing from what currentStyle.getPath() is reporting?

Thank you for any suggestions!

Garth

1 Accepted Solution

Avatar

Correct answer by
Level 10
4 Replies

Avatar

Correct answer by
Level 10

Avatar

Former Community Member

I'm using CQ5.5.2 & having very similar issue. Unfortunately no solution.

I have a parsys, inside the parsys there can either be a paginated article or a single page article. There is also another component trivia present in the same parsys & trivia shows up at the end of the article. When author does not use pagination everything works fine, the design_dialog path in CRX & path returned currentStyle.getPath() are same & the path is as below :-
/etc/designs/mysite/home/jcr:content/article/content/columns/pageColumnMain/article/parsys/trivia

         But I run into issues when author uses pagination. When pagination is used, design_dilog path in CRX & the path returned by currentStyle.getPath() differs & the path returned by currentStyle.getPath() is as below:-
/etc/designs/mysite/home/jcr:content/article/content/columns/pageColumnMain/article/trivia


It would be great if someone can add information about how actually currentStyle.getPath() works?

I'm reading the common data saved under /etc/designs/mysite/home/jcr:content/article/content/columns/pageColumnMain/article/parsys/trivia to show in trivia component.

Thank You in advance!

Avatar

Level 2

smacdonald2008 wrote...

There is a StackOverflow thread that may help:

http://stackoverflow.com/questions/19061568/using-currentnode-with-design-dialog


 

 

Sadly, I don't think this helps me.  I'm not trying to use a design_dialog as the sole source of configurable properties for the "quick-links-button" component, just for setting a common property that all the buttons will access. The component also has its own regular dialog for capturing all the properties specific to each instance. (All of which should be standard practice.  I don't think I'm bending the rules anywhere.)

If anything, the code from this stackoverflow post confirms the path-forming discrepancy that I'm trying to resolve:

<% if(session.nodeExists(currentStyle.getPath())) { Node node = session.getNode(currentStyle.getPath()); %><%=node.getIdentifier()%><%     } else { %><p>Node doesn't exist</p><%     } %>

I always get the message "Node doesn't exist", which is true.  The design_dialog is writing the property to a different path than what currentStyle.getPath() is reporting.

Why the design_dialog and currentStyle.getPath() for this component don't agree is what I'm trying to figure out and resolve.

Avatar

Former Community Member

garth914 wrote...

smacdonald2008 wrote...

There is a StackOverflow thread that may help:

http://stackoverflow.com/questions/19061568/using-currentnode-with-design-dialog


 

 

Sadly, I don't think this helps me.  I'm not trying to use a design_dialog as the sole source of configurable properties for the "quick-links-button" component, just for setting a common property that all the buttons will access. The component also has its own regular dialog for capturing all the properties specific to each instance. (All of which should be standard practice.  I don't think I'm bending the rules anywhere.)

If anything, the code from this stackoverflow post confirms the path-forming discrepancy that I'm trying to resolve:

  1. <%
  2. if(session.nodeExists(currentStyle.getPath())) {
  3. Node node = session.getNode(currentStyle.getPath());
  4. %><%=node.getIdentifier()%><%
  5.     } else {
  6. %><p>Node doesn't exist</p><%
  7.     }
  8. %>

I always get the message "Node doesn't exist", which is true.  The design_dialog is writing the property to a different path than what currentStyle.getPath() is reporting.

Why the design_dialog and currentStyle.getPath() for this component don't agree is what I'm trying to figure out and resolve.

 

I have also ran into the same issue of discrepancy between design_dialog & currentStyle.getPath(). Unfortunately, I do not have a solution for this issue as of now.

I have a parsys & inside the parsys I have pagination & a couple of other components. When author does not use pagination everything works fine, both design_dialog path & currentStyle.getPath() returns same. But I run into issues when author uses pagination. When pagination is used design_dilog path & currentStyle.getPath() differs.