开发者

Easy way of creating tabs in a Liferay portlet?

开发者 https://www.devze.com 2023-04-01 17:37 出处:网络
Ello there开发者_StackOverflow中文版, Does anyone know of an easy way to create tabs in a Liferay portlet? Been reading up on it and I just can\'t seem to find any suggestions on how to do this quite

Ello there开发者_StackOverflow中文版,

Does anyone know of an easy way to create tabs in a Liferay portlet? Been reading up on it and I just can't seem to find any suggestions on how to do this quite easily.

Would be great if someone that has experience with this could give me some pointers.

Thanks!


Use the Liferay UI TagLib!

First import the TagLib,

<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

Now you can use this,

<liferay-ui:tabs
    names="questions,tags,users,badges,unanswered"
    param="tab"
    url="<%= myURL.toString() %>"
/>
  • The name attribute is comma separated with the names of your Tab.
  • The url attribute will be a URL where the param attribute will be appended to as a param.

Alternatively, you can explicitly set the URL for each tab.

<liferay-ui:tabs
    names="questions,tags,users,badges,unanswered"
    url1="<%= questionsURL.toString() %>"
    url2="<%= tagsURL.toString() %>"
    url3="<%= usersURL.toString() %>"
    url4="<%= badgesURL.toString() %>"
    url5="<%= unansweredURL.toString() %>"
/>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号