Reputation:
Ello there,
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!
Upvotes: 2
Views: 3863
Reputation: 3465
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() %>"
/>
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() %>"
/>
Upvotes: 6