Message Boards

Liferay main CMS page customization

Aleksandar Foltin, modified 2 Years ago.

Liferay main CMS page customization

New Member Posts: 2 Join Date: 10/19/21 Recent Posts

Hello everyone, I have a question about Liferay 7 main CMS page customization. More precisely, I would need some customizable part of the main CMS page that would act as a host application for a microfrontend framework that needs to be integrated into Liferay. I have managed to do this with a custom portlet/widget, but in this case, the user needs to drag in the portlet into the page to make it work. I need this to work by default, without a need for the user to drag in the portlet. I have also read in the documentation that another way of customization is through themes. In which direction should I go then? Are there some other ways of customization that I should consider? Thanks everyone!

thumbnail
Olaf Kock, modified 2 Years ago.

RE: Liferay main CMS page customization

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

There's an API for adding elements (widgets) to pages - no need to ask people to manually add stuff to pages.

You can also embed stuff in your theme as you like.

Both are techniques where change most likely must be done by a developer (unless the component is added to a page once and then can be manually changed)

I'd recommend to create an Upgrade routine (that executes once) and utilizes the API to add your component to the page of your choice, then leave any future changes up to the user.

Aleksandar Foltin, modified 2 Years ago.

RE: RE: Liferay main CMS page customization

New Member Posts: 2 Join Date: 10/19/21 Recent Posts

Hey Olaf, thanks for the quick answer, good to know what options I get to choose! However let me be more precise, just to be sure we understand each other. I am a developer, and I need to customize the Liferay CMS edit page, which our product consumers are going to use for the customization of their own UIs. The edit page should by default include the javascript code which bootstraps the microfrontend platform (the microfrontend part is not much relevant for my question, suppose that I just want any regular javascript code included by default). This javascript code should also remain present on the page after the CMS editing is done and the changes are published. Basically, some kind of a preset. From my point of view, I should probably go with the theme solution, not sure if widgets would be suitable, please correct me if I am wrong. Thanks again!