Foros de discusión

processor.ProcessPortlet into a layout, portlet CSS and JS are not loaded

thumbnail
Baptiste Grenier, modificado hace 14 años.

processor.ProcessPortlet into a layout, portlet CSS and JS are not loaded

Regular Member Mensajes: 100 Fecha de incorporación: 30/06/09 Mensajes recientes
Hello,
Using the Plugins SDK I have created a custom layout tpl, and in this portlet I added a custom portlet using
$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:
<portlet>
    <portlet-name>menu</portlet-name>
    <icon>/icon.png</icon>
    <instanceable>false</instanceable>
    <header-portlet-css>/css/menu.css</header-portlet-css>
    <footer-portlet-javascript>/js/jquery-timers.js</footer-portlet-javascript>
    <footer-portlet-javascript>/js/menu.js</footer-portlet-javascript>
    <add-default-resource>true</add-default-resource>
  </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, modificado hace 13 años.

RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load

New Member Mensajes: 20 Fecha de incorporación: 28/08/09 Mensajes recientes
Hello Baptiste,

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

Best Regards,
Shawn
thumbnail
Raja Nagendra Kumar, modificado hace 13 años.

RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load

Expert Mensajes: 484 Fecha de incorporación: 2/03/06 Mensajes recientes
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
thumbnail
Hitoshi Ozawa, modificado hace 13 años.

RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Hello, have you found a solution !!! I have the same issue
.

Mohammed, can you share your solution with us?
thumbnail
Mohammed Haitam LAARABI, modificado hace 13 años.

RE: processor.ProcessPortlet into a layout, portlet CSS and JS are not load

New Member Mensaje: 1 Fecha de incorporación: 9/04/10 Mensajes recientes
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,