2 Replies Latest reply on Jan 7, 2013 11:34 PM by Ove Lindström

    Getting Data from other pages

    Prem Pratick Kumar

      Hi,

       

      We have a Template --> Section Page. This Template has a component which captues "Summary".

       

      Home Page -> Section Page -1

                           Section Page -2

                           Section Page -3

       

      The Homapge should display Image+Summary+Link to the Child Section pages.

       

      I am able to get the Link(Page URL), how to get the Image and summary text that was selected in the Section page.

       

      Thanks,

      Prem Pratick Kumar

        • 1. Re: Getting Data from other pages
          Raja_Raju_Learner Level 1

          Hi Prem,

           

          I hope you want to get the data entered in the child pages and display it in home page. If this is what your requirement is,

           

          Navigate to the HomePage, get children using listChildren() method. Access the node using getContentResource(String relPath).

           

          Then you can use this Node to retrieve all the properties in that node. After this you can use them to display in your jsp.

           

          hope this may help if your requirement is the same as my understanding.

           

          Regards,

          Raja R

          • 2. Re: Getting Data from other pages
            Ove Lindström Level 4

            I would do a variant of Rajas solution.

             

            Since I am not a big fan of letting anyone else than the data owner do the rendering, I would also use the same listChildren to get the next part of the path. If the Summary component path/attribute name is known, then you can build a path to that component node and then call it with a sling:include. Take a look at foundation/components/reference. That one can be used as inspiration and the sling:include call would then need to add selectors according to how you want to display the component. (http://dev.day.com/docs/en/cq/current/howto/taglib.html#<sling:include>)