Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

CQ pages creation

madhava_lekkala
Level 1
Level 1

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

1 Accepted Solution
gaurav_mishra
Correct answer by
Level 2
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

0 Replies
gaurav_mishra
Correct answer by
Level 2
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

kchs_rk
Level 2
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

madhava_lekkala
Level 1
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.

blakhal
Level 1
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

Krishna_C
Level 4
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