Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Adding Portlet Programmatically in Content page
Hi 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
Hi,
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
@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 ?
Thanks 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.
Hi Aravinth,
This is off topic, I have a question - What type of module (project template name) did you create for SI?
Regards,
Prathibha
Powered by Liferay™