I am using liferay 7 and trying to create a content component which contains a jquery plugin and some css&html? What is the best way to create this?
Asked
Active
Viewed 245 times
-2
-
wow, this is a really broad question for liferay. when you say component, you mean a portlet? or you are looking for something less specific. if it is really simple you can even use the web content portlet, and just drop in a page. But I can start by telling you that jquery plugin are not too trivial, https://web.liferay.com/community/forums/-/message_boards/message/79089004 – Victor Nov 02 '17 at 20:59
-
also: https://stackoverflow.com/questions/39490126/jquery-plugin-in-a-liferay-7-theme – Victor Nov 02 '17 at 20:59
1 Answers
0
I think the best approach is to use this https://github.com/liferay/liferay-blade-samples/tree/master/gradle/apps/npm/jquery-npm-portlet
The README file contains a link to documentation and you can work your way through it to get more inside.
Not that these features are available only in the latest version of Liferay (Liferay-ce-ga5 https://web.liferay.com/web/jamie.sammons/blog/-/blogs/liferay-portal-7-0-ce-ga5-release or DXP FP30+)

Miroslav Ligas
- 1,287
- 8
- 22
-
The question is actually more about jquery-UI: https://stackoverflow.com/questions/47088356/how-to-use-jquery-ui-in-liferay-7-page – bier hier Nov 04 '17 at 03:11
-
It depends on how do you want to bundle it. If you want to develop apps with jquery and jquery-ui the above is the best way. If you just want to slam jquery-ui into the page and have it as a global thing then use the script tag approach. Be aware that if you go with the global path you might run into version problems in the future. – Miroslav Ligas Nov 04 '17 at 09:21
-
Actually I want to use a tab control, is there another way to do this? – bier hier Nov 04 '17 at 09:25
-
-
If you just need tabs and you don't care too much about the JS library have look at his. https://alloyui.com/tutorials/tabview. And yes you can use liferay ui tags in ftl. <@liferay_ui["NAME_OF_TAG"] – Miroslav Ligas Nov 04 '17 at 09:30