Message Boards
Adding Portlet Programmatically in Content page
Adding Portlet Programmatically in Content page
Regular Member Posts: 152 Join Date: 6/26/13 Recent PostsHi Team,
We are exploring on Liferay CONTENT pages like creating it programmatically, setting page templates, adding portlets to it, adding fragments. etc. We were able to create the page using page template, it works as expected.
We tried placing a portlet in content page but it doesnt show up in the page. Can someone suggest on this.
API used to place a portlet:
1. Created fragment entry link
2. Added layout structure item in layout structure object
3. Updated layoutpagetemplatestructure.
Regards,
Aravinth
RE: Adding Portlet Programmatically in Content page
Liferay Master Posts: 591 Join Date: 8/8/14 Recent PostsHi,
You can refer Site Initializers Blog, may be it will help you
https://liferay.dev/en/b/site-initializers-101
Also you can refer sample site initializers for api
RE: RE: Adding Portlet Programmatically in Content page
New Member Posts: 7 Join Date: 10/21/21 Recent Posts@Mohammed Yasin,
Have you implemented site initializer , please can you provide more info. How do you initiate SI and did you also use SI for updates of site or only new site ?
RE: Adding Portlet Programmatically in Content page
Regular Member Posts: 152 Join Date: 6/26/13 Recent PostsThanks for your response. Yes I used the above link and created the page, etc. Only I m not able to place a portlet onto a content page.
I'm checking on liferay source code to understand the fragments and layoutstructures used in content page.
RE: RE: Adding Portlet Programmatically in Content page
New Member Posts: 7 Join Date: 10/21/21 Recent PostsHi Aravinth,
This is off topic, I have a question - What type of module (project template name) did you create for SI?
Regards,
Prathibha