Skip navigation

CQ5

spaceling
Currently Being Moderated

Questions from a "noob"

May 22, 2012 3:11 PM

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!

 
Replies
  • Justin Edelson
    252 posts
    Nov 24, 2010
    Currently Being Moderated
    May 22, 2012 5:38 PM   in reply to spaceling

    Hi spaceling,

    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.

     

    HTH,

    Justin

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 11:08 PM   in reply to spaceling

    you have to get tha value that you would enter in dialog field vi properties ... then you canable to use that

     
    |
    Mark as:
  • Justin Edelson
    252 posts
    Nov 24, 2010
    Currently Being Moderated
    May 24, 2012 11:48 AM   in reply to spaceling

    something like:

    pageB.getContentResource("componentB").adaptTo(ValueMap.class);

     

    (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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points