Hello Rafael,
I have the same purpose, which is creating new page.
I modified forum_list.htm to show the list of categories. Those link can be clicked by adding
${category.name?html}
I also made changes on :
TemplateKeys.java ==>
public class TemplateKeys
{
private TemplateKeys() {}
public static final
String FORUMS_LIST = "forums.list";
public static final String FORUMS_SHOW = "forums.show";
public static final String FORUMS_PING = "forums.ping";
public static final String FORUMS_BANNED = "forums.banned";
public static final String FORUMS_CATEGORY = "forums.category";
...........
ForumAction.java ==>
public void forumsByCategory() throws Exception{
Category c = new Category();
c = ForumRepository.getCategory(this.request.getIntParameter("categories_id"));
this.setTemplateName(TemplateKeys.FORUMS_CATEGORY);
this.context.put("getCategory", c);
}
templateMapping.properties ==>
forums.category = forum_by_category.htm
urlPattern.properties ==>
forums.category.1 = categories_id
and create this page (forum_by_category.htm) ==>
.....
<#list getCategory as category>
<tr>
<td class="catleft" ><span class="cattitle">${category.name}</span></td>
<td class="catright" > </td>
</tr>
<#list category.getForums() as forum>
<#assign lpi = forumRepository.getLastPostInfo(forum.id)/>
<tr>
<td class="row1" >
<#if forum.unread>
<#else>
</#if>
</td>
<td class="row1" >
<span class="forumlink">
${forum.name?html}</span>
<span class="genmed">
${forum.description?default("")}
<#if forum.isModerated()>
Moderated Forum
</#if>
</span>
</td>
<td class="row2" ><span class="gensmall">${forum.totalTopics}</span></td>
<td class="row2" >
<#assign total = forum.totalPosts/>
<#if (total == 0 && forum.totalTopics > 0)>
<#assign total = forum.totalTopics/>
</#if>
<span class="gensmall"><#if (total > 0)>${total}<#else>${I18n.getMessage("ForumListing.noMessages")}</#if></span>
</td>
<td class="row2" >
<span class="postdetails">
<#if (lpi.postTimeMillis > 0)>
${lpi.postDate}
<#if (lpi.userId > 0)>
</#if>${lpi.username}
<#assign startPage = ""/>
<#if (lpi.topicReplies + 1 > topicsPerPage)>
<#assign startPage = ((lpi.topicReplies / topicsPerPage)?int * topicsPerPage) +"/"/>
</#if>
<#assign url = JForumContext.encodeURL("/posts/list/${startPage}${lpi.topicId}") + "#" + lpi.postId/>
<#else>
${I18n.getMessage("ForumListing.noMessages")}
</#if>
</span>
</td>
</tr>
</#list>
</#list>
<!-- END OF FORUM LISTING -->
......
but when clicked one of the category.. it's going nowhere.. it still display the same page.
Is there any other file that I need to be configured?
Thanks
-hanapewee-
[originally posted on jforum.net by hanapewee]