留言板

Hook custom Taglib

Camilla M.,修改在13 年前。

Hook custom Taglib

New Member 帖子: 3 加入日期: 10-10-9 最近的帖子
Hi there,

for my current portlet project I developed a custom "calendarType" taglib and I want it to be adapted by the liferay portal as well.

Does anybody know how to "hook" a taglib for the liferay portal source?

Greets
Camilla
thumbnail
Andrés Cerezo,修改在13 年前。

RE: Hook custom Taglib

Junior Member 帖子: 92 加入日期: 10-11-11 最近的帖子
Hello, I've the same problem, Did you find the solution?

Cheers.
thumbnail
Patrick NERDEN,修改在11 年前。

RE: Hook custom Taglib

New Member 帖子: 10 加入日期: 10-4-16 最近的帖子
Same question here : how can I add a custom taglib through a hook instead of an ext-plugin ?
thumbnail
Nicolas Forney,修改在11 年前。

RE: Hook custom Taglib

Junior Member 帖子: 78 加入日期: 11-5-23 最近的帖子
Hello,

Sorry for digging up old post, but I'm asking myself the same question and there is still no answer...

Any idea if it's possible to use hook to overwrite liferay taglibs ? Or isn't it only possible through an ext plugin?

Thx
thumbnail
Nicolas Forney,修改在11 年前。

RE: Hook custom Taglib

Junior Member 帖子: 78 加入日期: 11-5-23 最近的帖子
Well, finally it's pretty easy to hook taglibs.

Just create a hook plugin set the following line in the liferay-hook.xml :
<hook>
    <custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>      
</hook>


Then, add the taglib files you want to override inside the custom_jsps folder of your project.
docroot/META-INF/custom_jsps


Let say you want to override the liferay-ui:header, just copy the init.jsp file and the page.jsp located in the Liferay sources into :
 portal-web/docroot/html/taglib/ui/header

and then, copy the files to your project in the following folder :
docroot/META-INF/custom_jsps/html/taglib/ui/header
.

You can now deploy your hook !

I did this with Liferay 6.1
thumbnail
Reigo Reinmets,修改在9 年前。

RE: Hook custom Taglib

New Member 帖子: 4 加入日期: 10-7-29 最近的帖子
I had a similar issue but I wanted to create my own custom taglib that I could use in my many different portlet projects and render the JSP's like liferay tags do it. Turns out it's not THAT difficult but does require you to split the Hook and Taglib itself into separate projects so that you could reference the taglib project via Maven during development time and keep Eclipse from complaining.

Here's a short tutorial on how I did it: http://www.codeyouneed.com/how-to-create-a-taglib-with-jsps-for-liferay