7 Replies Latest reply on Apr 3, 2012 10:17 AM by MatheusOliveira

    Best way to create functional pages

    Willy jojo

      We are getting ready to migrate all our content and functional pieces from out old CMS to CQ5. We have 20 or so pages that are not managed for content. They are basically forms that handle calculations. So we don't really need these in CRX for content managers to open and edit.


      So I am wondering what is the best way to go about this? We'll need one template I suppose, but twenty pages will need to created and very customized forms will need to be created that likely would be better off not being editable in CQ.


      So I guess my real question is where do we put these files? How do we build them. The code is already there, we just need to find them a home. Maybe a example of a tree structure would be helpful, or if there are tutorials anywhere that deal with this type of thing.

        • 1. Re: Best way to create functional pages
          justin_at_adobe Adobe Employee

          I would treat these exactly like any other page. The only distinction is that they do not have any authorable components on them and thus have more hard-coded HTML in the page component.




          • 2. Re: Best way to create functional pages
            Willy jojo Level 1

            Where do you create them?


            Specifically, I am working on some forms. Are there any simple examples of how these should be set up. LIke you said though, they aren't authorable, so where do I create them?

            • 3. Re: Best way to create functional pages
              justin_at_adobe Adobe Employee

              These would just be pages like any other, so the cq:Page nodes would likely go under /content/<mysite> and the corresponding page components would go under /apps/<mysite>/components/page.


              If you have an existing naming convention, you would likely follow that.


              The fact that these pages don't have authorable components is irrelevant as to where the code goes.

              • 4. Re: Best way to create functional pages
                Willy jojo Level 1

                So the html would be created in the CRX content explorer (http://localhost:4502/crx/browser/index.jsp)? Or would they be created like any other page in CQ from templates (http://localhost:4502/libs/wcm/core/content/siteadmin.html#/content/geometrixx/)?

                • 5. Re: Best way to create functional pages
                  justin_at_adobe Adobe Employee

                  Either way would work. The latter requires that you have Templates defined for these pages, which might be overkill, whereas the former is just rote repetition (although I'd use CRXDE Lite rather than the content explorer). The other option would be to write a little shell script using curl. It's really a toss up.

                  • 6. Re: Best way to create functional pages
                    Willy jojo Level 1

                    Do you know of any examples that would show how this would work? I think I am missing something basic because I am getting nowhere. Basically if I could have one page post to another and have that page handle the form values, that would be very helpful.

                    • 7. Re: Best way to create functional pages
                      MatheusOliveira Level 1



                      According to the CQ5 Developer Training, the best way to do a website structure like these one is by the following steps:


                      1 - Create a CRX Project (By CRXDE Lite or CRX DE): you need to start by this step because any components that will be used in your site need to be created and managed by CRX. Besides, all the coding (html, css, javascript, jsp, etc) you'll do in the CRX, not in the CQ WebSites.

                      2 - After create a project, the first component you need to build is the template. The template defines wich components can be used within the selected scope. Every page you'll create after the structure building process will be related to this template.

                      3 - After the template, you'll build the Page-rendering component. This is the first definition of pages, and inside this component you will create the html/jsp/others pages.

                      4 - By now, you will be able to create a website and pages in the CQ5 WebSites using the template that you created in step 2 and the pages will look exactly like the

                      page-rendering component created in the step 3. Everything after that is are adittionals, like a logo component, a parsys component, a serch component, etc.


                      Here you can see the structure of folders/components in CRX that I created following the Exercise Guide of the Developer Training.


                      CRX Project structure.jpg


                      Hope that these informations can help you.