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: Multiple portlet in single Vue project
Hello.Any idea how to add new portlet in existing Vue project?
I only see one config to create portlet in project.
How to add another portlet here?
"portlet": {
"com.liferay.portlet.display-category": "category.sample",
"javax.portlet.name": "vueliferaydemowidget",
"javax.portlet.security-role-ref": "power-user,user",
"javax.portlet.resource-bundle": "content.Language",
"com.liferay.portlet.instanceable": true
}
Thanks
I only see one config to create portlet in project.
How to add another portlet here?
"portlet": {
"com.liferay.portlet.display-category": "category.sample",
"javax.portlet.name": "vueliferaydemowidget",
"javax.portlet.security-role-ref": "power-user,user",
"javax.portlet.resource-bundle": "content.Language",
"com.liferay.portlet.instanceable": true
}
Thanks
Hi Hairi:
You can't. You can only create one JavaScript portlet per package.json. If you need another portlet, just create a new project.
You can't. You can only create one JavaScript portlet per package.json. If you need another portlet, just create a new project.
Thanks Ivan for your reply.Just thinking how Portlet1 can re-used components that inside Portlet2 if both portlets in different project workspace
You can use a provider project for that. Check the example here -> https://github.com/izaera/liferay-js-toolkit-showcase/tree/react
The idea is to put all common code in a provider project which doesn't implement a portlet, but just carries shared code. Then, that code (modules) is imported configuring the imports section of the .npmbundlerrc files.
The idea is to put all common code in a provider project which doesn't implement a portlet, but just carries shared code. Then, that code (modules) is imported configuring the imports section of the .npmbundlerrc files.