Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Baptiste Grenier
processor.ProcessPortlet into a layout, portlet CSS and JS are not loaded
December 4, 2009 8:36 AM
Answer

Baptiste Grenier

Rank: Regular Member

Posts: 100

Join Date: June 30, 2009

Recent Posts

Hello,
Using the Plugins SDK I have created a custom layout tpl, and in this portlet I added a custom portlet using
1$processor.processPortlet("menu_WAR_menuportlet")

The portlet is displayed into the layout, but the CSS and JavaScript files included into the portlet are not loaded.

Using $themedisplay.runtime produces the same result.

My portlet was developped using the Plugins SDK too, and the CSS and JS files are declared in the liferay-portlet.xml:
 1<portlet>
 2    <portlet-name>menu</portlet-name>
 3    <icon>/icon.png</icon>
 4    <instanceable>false</instanceable>
 5    <header-portlet-css>/css/menu.css</header-portlet-css>
 6    <footer-portlet-javascript>/js/jquery-timers.js</footer-portlet-javascript>
 7    <footer-portlet-javascript>/js/menu.js</footer-portlet-javascript>
 8    <add-default-resource>true</add-default-resource>
 9  </portlet>

When adding the portlet to a page using the add application tool it works as expected, both the JavaScript and CSS files are loaded and everything is well rendered.

I also tried to add my portlet to portal_normal.vm in a theme, but the result was exactly the same, both portlet's JavaScript and CSS files were not loaded.

If I add the CSS/JS files in my theme the portlet is well displayed, but I don't find having to copy my CSS/JS from the portlet to the theme really clean...

Am I missing something or could this be the expected comportment?

Regards,
Baptiste
Shawn G
RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load
January 28, 2011 8:12 AM
Answer

Shawn G

Rank: New Member

Posts: 20

Join Date: August 28, 2009

Recent Posts

Hello Baptiste,

I am experiencing the same thing, did you ever find a solution?

Best Regards,
Shawn
Raja Nagendra Kumar
RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load
April 1, 2011 8:07 PM
Answer

Raja Nagendra Kumar

Rank: Expert

Posts: 484

Join Date: March 1, 2006

Recent Posts

Looks like the issue with CSS and JS paths.

Can you try putting the CSS and JS files needed as part of parent portlet and see if things work fine.

Or put the resources as part of them and try it out

If one them works, then try

http://www.liferay.com/community/forums/-/message_boards/message/772138
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1082781



Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
Hitoshi Ozawa
RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load
April 1, 2011 9:21 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Hello, have you found a solution !!! I have the same issue
.

Mohammed, can you share your solution with us?
Hawk Corleone
RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load
August 28, 2012 8:27 AM
Answer

Hawk Corleone

Rank: New Member

Posts: 1

Join Date: April 9, 2010

Recent Posts

Thank you for your response [Raja Nagendra Kumar].
I'm sorry for late [Hitoshi Ozawa] I didn't notice your reply.

I don't know if there is a solution to call properly (bounded with js and css files...) a portlet from vm but to get out from this issue we just need to put CSS add JS call in the portlet JSP (classic way emoticon). otherwise, we need to create our layout template then use a processColumn to book spots for portlets after that it remains to put our portlets in their place on the GUI mode (drag & drop).

I hope this may help !!

My Best Regards,