フォーラム

ホーム » Alloy UI » English

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Kiran Kumar Boyini
How to use jquerry in liferay.
2012/12/07 1:14
答え

Kiran Kumar Boyini

ランク: Expert

投稿: 282

参加年月日: 2011/06/02

最近の投稿

Hi All,

I want to use jquerrry in liferay 6.0.6.
Suppose I want to use it in jsp.How I have to use it or liferay internally have this js library or i have to import this in externally .


Please provide the reply.

Thanks,

Kiran
Jitendra Rajput
RE: How to use jquerry in liferay.
2012/12/07 1:26
答え

Jitendra Rajput

ランク: Liferay Master

投稿: 858

参加年月日: 2011/01/07

最近の投稿

From Liferay 6 onwards jquery no longer included by default . You need to explicitly include it in your portlet or theme (if you want to use in all portlets).

Below blog will help you on the same.
http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/using-jquery-or-any-javascript-library-in-liferay-6-0
Oliver Bayer
RE: How to use jquerry in liferay.
2012/12/07 1:30
答え

Oliver Bayer

ランク: Liferay Master

投稿: 889

参加年月日: 2009/02/18

最近の投稿

Hi Kiran,

it depends emoticon.

If you want to use it in a single jsp use the html script-tag to include it.

If you want to use it in multiple places/ different portlets you have two possibilities:
- you can put the jquery js file in a custom theme (theme dependant but you can insert business logic how and when you include it) or
- use the "javascript.barebone.files" property in the portal-ext.properties file so jquery is always available e.g. also in the control panel portlets (theme independant)

Greets Oli
Kiran Kumar Boyini
RE: How to use jquerry in liferay.
2012/12/07 5:01
答え

Kiran Kumar Boyini

ランク: Expert

投稿: 282

参加年月日: 2011/06/02

最近の投稿

Thank you Jitendra,

I follow the link and I am try to develop the jquerry portlet by following the links w r to your link.

http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/using-jquery-or-any-javascript-library-in-liferay-6-0

But here I am not understanding the following things.

Build a project called “sample-jquery-portlet” with folder “docroot” and build.xml
Add CSS under the folder /docroot/css
Add images under the folder /docroot/css
Add jquery under the folder /docroot/js
Add liferay-display.xml, liferay-plugin-package.properties, liferay-portlet.xml, portlet.xml under the folder /docroot/WEB-INF
Especially, add following lines, for example, in the file liferay-portlet.xml.
<portlet>
<portlet-name>1</portlet-name>
<icon>/images/world.png</icon>
<header-portlet-css>/css/style.css</header-portlet-css>
<header-portlet-javascript>/js/jquery.js</header-portlet-javascript>
<footer-portlet-javascript>/js/jquery-ui-custom.js</footer-portlet-javascript>
<css-class-wrapper>sample-jquery-portlet</css-class-wrapper>
</portlet>


and also I am not understand the following statement.
Note that the property header-portal-javascript sets the path of JavaScript that will be referenced in the page's header relative to the portal's context path; and the property footer-portal-javascript sets the path of JavaScript that will be referenced in the page's footer relative to the portal's context path.
But in the above where I can find the jquery-ui-custom.js filw and I have a bit confusion to create the directory structure. as he mentioned in the document.
I have created docroot folder,inside i have created css,js foloders. And I am putting the .css,.png.,.jpg files in css folder.

Am I correct ?

Thanks,

Kiran