CQ pages creation | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by gaurav_mishra

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.

5 replies

gaurav_mishra
gaurav_mishraAccepted solution
Level 2
October 16, 2015

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.

Level 2
October 16, 2015

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

October 16, 2015

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.

October 16, 2015

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

Krishna_C
Level 3
October 16, 2015

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