Message Boards

Add Web Content to Page Programmatically.

Sanat D, modified 3 Years ago.

Add Web Content to Page Programmatically.

New Member Posts: 17 Join Date: 9/8/20 Recent Posts

Hello everyone,

In Liferay, I can create a content page and web content programmatically successfully. Since, both my page and web content created programmatically now I wanted to assign that web content directly to the page by coding. Is it possible and if the answer is yes then how can I achieve this?

I read some Liferay forum answer to do this which tell that using the theme we can assign created web content to page buy I can't find an answer for the java side. So please let me know if anyone has knowledge regarding this. 

Thanks in advance.

thumbnail
Olaf Kock, modified 3 Years ago.

RE: Add Web Content to Page Programmatically.

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

Sure it's possible. And while I don't have the full recipe that you just need to follow, you can start by inspecting how a page itself is set up with this simple and ugly plugin.

Note: The method you choose to set up your page will differ significantly between Widget- and Content-Pages.
Note2: As of the time I'm writing this answer, the link above is barely visible. There's a link!

Sanat D, modified 3 Years ago.

RE: RE: Add Web Content to Page Programmatically.

New Member Posts: 17 Join Date: 9/8/20 Recent Posts

Thanks Olaf Kock for suggestion and plug-in.I am trying to explain you my brief requirement :

1. Migrate pages from legacy system and create exact replica in liferay.

2. Migrate content of that pages from legacy system and create web content as a exact replica in liferay.

3.According to liferay, need to associate pages from point 1. and web content from point 2 to dispaly content in traditional way.

4.Pages are widget pages and pages can have hierarchy.

I will be really greatefull if you  please suggest how to achieve third(3) point.

Sanat D, modified 3 Years ago.

RE: Add Web Content to Page Programmatically.

New Member Posts: 17 Join Date: 9/8/20 Recent Posts

Thank you. i created it.