Fórum

Fail to include custom js in jsp of DXP Hook

Kushagra Khanna, modificado 6 Anos atrás.

Fail to include custom js in jsp of DXP Hook

Junior Member Postagens: 45 Data de Entrada: 28/12/14 Postagens Recentes
Hi Team,

I am facing one problem with DXP Hook as I have hooked a jsp of Liferay Polls portlet and want to add js on the same page but fail to achive the same as same thing is working fine for LR 6.1, I think there must be issue with the js path, please any one tell me that where I can put my custom js in DXP Hook structure and what would be the path should I use so I can get that particular js.

Please provide suggestions on this.

Thanks,
Kushagra
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: Fail to include custom js in jsp of DXP Hook

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
You shouldn't be doing this as a JSP fragment bundle because you shouldn't be adding js/css via the JSP.

You add js/css via the portlet annotation properties. There's a hint as how you can change the properties on the annotation using a configuration file. It's hinted about here: https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/overriding-service-references#configure-the-component-to-use-the-custom-service.

Basically the config file will provide the properties overrides when named correctly and you can specify the JS path to include.

I think there's a better, more decisive document out there, I just haven't been able to find it in a brief search.








Come meet me at the 2017 LSNA!
Kushagra Khanna, modificado 6 Anos atrás.

RE: Fail to include custom js in jsp of DXP Hook

Junior Member Postagens: 45 Data de Entrada: 28/12/14 Postagens Recentes
Hi David,

Thanks for your reply, I will go through the link shared by you.