Question

Is it posible in Liferay to change the default Structure/Template depends on Content Type.

The request is to set 3 empty Web-Content-Display Portlets per Page, and authors should insert the content in this portlets. But this 3 Portlets should have different kinds of Structure/Template. The authors shouldn't have permissions to change the Structure. Hence, i would set the default Structure to Web-Content-Portlet or to Journal-Portlet in the depends on Content-Type.

How can I solve it? Or some other solution for this request?

Was it helpful?

Solution

I dont think this is possible to do Out of the box. But here is a suggestion which I have not tried and may work for you

You can create property cum jsp hook for the page edit_article.jsp. In the hook you can add 3 properties for each structure id. Now in the edit_article.jsp you would see the following line

String structureId = BeanParamUtil.getString(article, request, "structureId");

You have to retrieve the structure id from property on journal content type change somehow and then it should work for you. You do not have to worry about template as structure by default is associated with a template.

You can try this and let us know the result. Just a pointer as I have not really tried this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top