I am very new to Adobe CQ. I've been sifting through the scarce documentation and trying to come up to speed, but I've found it very difficult to find what I need. I think I'm at a point in which I understand (to a point) the overall architecture and how to do basic things (mostly theoretically).
I have a few questions that I was hoping somebody could point me in the right direction on. I would really appreciate the jumpstart.
- Is it possible to access page component properties? I am trying to create a generic component that can look at a page to see if it has a component embedded within it. If so, I want to iterate over the properties. I am using the page manager to get the page. Are the component properties included with the page properties of that page?
- How can I make a component accessible to any page? I added a property to my template named allowedPaths (which is depracated?) and its value is /content(/.*)? That only allows the component to be visible to pages created at the root of my websites in the WCM.
- How do you make a page's dialog actually save the entries you enter? I added a new cq:Panel (etc) to an existing dialog. I followed the same form that was there before. Basically there were 2 tabs and I added a new one, so there is now 3. I see my fields etc. When I enter in data and click "OK", my field data is not saved. It works for the pre-existing form fields, but not in the one I just added.
I hope the above questions made sense. I'm having a hard time trying to find the information that I need to start feeling comfortable using CQ.
Any help would be appreciated. Thanks in advance!
Just as a general comment, it's a good idea to try to post a single question per thread. That helps with findability.
1) page component properties - yes. <cq:defineObjects/> creates a scripting variables named currentPage and pageProperties. See http://dev.day.com/docs/en/cq/current/howto/taglib.html for a list of all the scripting variables this tag creates.
2) which components are accessible on which pages is determined by the design settings. These settings are specific to each template. See http://dev.day.com/docs/en/cq/current/developing/components.html#Addin g%20a%20new%20component%20to%20the%20paragraph%20system%20%28design%20 %20%20%20%20mode%29 for some instructions on doing this.
3) my guess is that the fields you added don't have a proper name property. Are the name (which are the names under which the field values are POSTed all start with ./ ? See http://sling.apache.org/site/manipulating-content-the-slingpostservlet -servletspost.html#ManipulatingContent-TheSlingPostServlet%28servlets. post%29-OmittingSomeParameters for why this is important and why if you don't have it, the fields don't get saved.
Thanks for the reply (and the tip) Justin.
1) I've been using this page to understand page variables. I am basically writing a component that (within it), will use the page manager to get a list of pages in some arbitrary location. Once I have those pages, I am trying to get access to the component properties of those pages (not the current one). Does that make sense?
2) Thank you. Along the same lines, can you tell me how to make a template accessible globally? I want to make a global template that can be used from any site. I think this is what I originally was asking, but I goofed up the wording on the question. I'm still trying to wrap my head around terminology (I am doing my best when posting here).
3) Thank you! That worked. Now I understand.
Thanks. I iterated over the properties, but the data I am looking for is not there.
Basically, what I want is:
ComponentA looks up PageA (already implemented)
PageA has ComponentB inside of it (already implemented)
ComponentA wants to see ComponentB's properties (not implemented) <<< What I need help with.
(you might also want to add a null check in the middle there)
This assumes that the path to componentB is /content/path/to/pageB/jcr:content/componentB.
Europe, Middle East and Africa