掲示板

Fail to include custom js in jsp of DXP Hook

6年前 に Kushagra Khanna によって更新されました。

Fail to include custom js in jsp of DXP Hook

Junior Member 投稿: 45 参加年月日: 14/12/28 最新の投稿
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
6年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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!
6年前 に Kushagra Khanna によって更新されました。

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

Junior Member 投稿: 45 参加年月日: 14/12/28 最新の投稿
Hi David,

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