Expand my Community achievements bar.

SOLVED

CQ pages creation

Avatar

Level 1

Can any one answer How to create CQ pages programatically which includes paragraph systems?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi Madhava,

Thank you for your question.  

To include paragraph system component while creating a CQ page, you can follow as below:

Add the parsys component (one of the foundation components) to your content page component.

i) In CRXDE Lite, browse to /apps/mywebsite/components/contentpage, open the file center.jsp and locate the following line of code: <div>parsys</div>

ii) Replace that line of code with the following code, then save the changes: <cq:include path="par" resourceType="foundation/components/parsys" />

iii) In your browser, refresh the Products page. It now has the parsys component.

 

To know more about creating a fully featured page, please visit our How to Create a Fully Featured Internet Website page.

 

If this answers your query on including paragraph systems, please mark this thread as SOLVED. This would help us in quicker resolution of similar queries.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 2

Hi Madhava,

Thank you for your question.  

To include paragraph system component while creating a CQ page, you can follow as below:

Add the parsys component (one of the foundation components) to your content page component.

i) In CRXDE Lite, browse to /apps/mywebsite/components/contentpage, open the file center.jsp and locate the following line of code: <div>parsys</div>

ii) Replace that line of code with the following code, then save the changes: <cq:include path="par" resourceType="foundation/components/parsys" />

iii) In your browser, refresh the Products page. It now has the parsys component.

 

To know more about creating a fully featured page, please visit our How to Create a Fully Featured Internet Website page.

 

If this answers your query on including paragraph systems, please mark this thread as SOLVED. This would help us in quicker resolution of similar queries.

Avatar

Level 2

Hi Madhava,

1) First create a page which have a parsys.

2) Then use below method to create pages dynamically.

copy(Page page, String destination, String beforeName, boolean shallow, boolean resolveConflict);

For example, pageManager.copy( existedPage, destinationPath, null, true, true );

So, every instance of your new page is a copy of existed one and hence you will get the parsys in it.

Hope this helps.

 

Ramakrishna

Avatar

Level 1

Hi I am not expecting to include the pargraph system in the component. i am expecting how to create CQ pages dynamically through programtic ? wnd while creating pages i need to include parsys as well programatically.

Avatar

Level 1

Hi Madhava,

here are some hints:

For creating a page you can use Pagemanager.
Including the parsys you can try something like this 
SlingHttpServletRequest sRequest;// get it

RequestDispatcher rd = sRequest.getRequestDispatcher(Resource resource, RequestDispatcherOptions options) ;
rd.include(ServletRequest request, ServletResponse response);

 

hope that helpe,

Bouchta

Avatar

Level 4

Hi Madhava,

You can create pages by program using pageManager class using below method.

create(String parentPath, String pageName, String template, String title)

Now you can design the template which contains a parsys in it .If you create page with the created template ,it will have parsys in it. 

Krishna