掲示板

hooks inside themes.war?

12年前 に Liferay newbie によって更新されました。

hooks inside themes.war?

New Member 投稿: 15 参加年月日: 11/04/14 最新の投稿
Is it possible to create hooks and place them under the themes dir structure? Can hooks and themes both have a single WAR file?

I did the following:

1) Modified web.xml under themes to include the listener tag (HookContextListener) for hooks
2) Added Liferay-hook.xml file under WEB-INF folder of Themes to mention the folder structure as WEB-INF/jsps/
3) Modified the required jsp files of liferay to obtain my customizations.

I now created the WAR for the themes. Will my hook get implemented inside the theme as expected ? Or should I have to create a seperate WAR for hooks?

Please guide.
thumbnail
12年前 に David H Nebinger によって更新されました。

RE: hooks inside themes.war?

Liferay Legend 投稿: 14915 参加年月日: 06/09/02 最新の投稿
No, bundling them in a single war makes sense if your theme is dependent upon the hook to function properly. If the theme is not dependent upon the hook, it is generally better to separate them into separate wars.

The theme/hook war as a single deployable will work just fine, though. LR should handle the deployment correctly.
12年前 に Liferay newbie によって更新されました。

RE: hooks inside themes.war?

New Member 投稿: 15 参加年月日: 11/04/14 最新の投稿
I tried bundling the theme and hook in same WAR. Though the theme got deployed and the hook was also deployed, the functionality, that the hook was written to perform, was not proper.

The hook was written to change the dockbar.jsp in liferay. I removed the pin/unpin function and realigned some of the dockbar elements. After I implemented the hook , the dockbar was completely dis functional. However, the hook written to change the navigation.jsp page was implemented correctly. I changed navigation.jsp in LR to remove the siteminder link, create account link from the login portlet.

I wonder if the way I tried to modify the dockbar was correct.

So technically speaking, hook and theme can be deployed as a single WAR but Im missing something functionally.
12年前 に Liferay newbie によって更新されました。

RE: hooks inside themes.war?

New Member 投稿: 15 参加年月日: 11/04/14 最新の投稿
I figured out where I went wrong in dockbar/view.jsp

In an attempt to remove the pin/unpin function of dockbar, I tried to comment out these lines:

<li class="pin-dockbar">
<a href="javascript:;"><img alt='' /></a>
</li>

which I understand, is the wrong way to remove any function in the dockbar. This totally corrupted my dockbar portlet. emoticon

Is there a better way to remove the pin function of dockbar?

Thanks.
12年前 に Daniel Wilmes によって更新されました。

RE: hooks inside themes.war? (回答)

Regular Member 投稿: 164 参加年月日: 11/05/23 最新の投稿
Inside your css for you theme put this css code:

.disable-pin-controls .pin-dockbar {
display: none;
}

In your vm file probably called int_custom.vm (both the cs and vm file should be in your _diff folder) paste this code.

#set($css_class="disable-pin-controls $css_class")
12年前 に Liferay newbie によって更新されました。

RE: hooks inside themes.war?

New Member 投稿: 15 参加年月日: 11/04/14 最新の投稿
thank you emoticon that was helpful