• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript and Css conflict in Liferay and plugin questions

 
Tony suankularb
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a newbie to Portal and Portlets (also, javascript and css).

When I create a portlet, I put css files and javascripts files in a folder of the portlet project.

So, I configure liferay-portlet.xml like this

<header-portlet-css>/MyJavaScript/jmodal.css</header-portlet-css>
<header-portlet-javascript>/MyJavaScript/myscript.js</header-portlet-javascript>



My question,
1. I've heard that it's not a good idea to put my own javascript to the project's folder. For example, other porlets cannot reuse the script.
So, where should I put my Javascript and also CSS files?

2. Sometime, the CSS of a Portlet affects the Portal theme's CSS when selector names of them are duplicate such as body{} of portlet css and body{} of theme css. How can I avoid this problem?

3. Also, when I add some new portlet, I cannot click on the liferay menu or the browser get minimized. I thinks it's because of Javascripts of portlet affects the liferay portlal. Do you know how to avoid this problem.


4. Now, I'm developing portlets on eclipse and use Ant to export War Files to the Deployt folder of the liferay. Then, I manually add portles to the page and test if they work.

This really is a time-consuming method and I cannot debug my portlets. I've not found any way to run and test portlets on Eclipse. Is there a plugin or a ways that allow me to do that?

Thank you
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Liferay plugin SDK will solve a lot of your problems. http://www.liferay.com/downloads/liferay-portal/additional-files
These provide tools for automatically creating and deploying portlets, themes, templates and hooks.

 
Tony suankularb
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, Tim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic