Listing Forums
To list all the forums in a publication:
<h2>Choose a Forum</h2> <forum:forums id="forums" recursive="true" sectionIds="${publication.rootSection.id}"/> <c:if test="${!empty forums }"> <ul> <c:forEach var="forum" items="${forums}"> <li> <a href="${pageContext.request.requestURL}?forumId=${forum.id}"> <c:out value="${forum.fields.title}"/> (forum ID ${forum.id}) </a> </li> </c:forEach> </ul> </c:if>
The forum:forums
tag (see forum:forums) is used to create a collection of
PresentationForum
beans (see PresentationForum)
representing all the forums in the publication: a link is then output
for each bean in the collection.