Forums / Setup & design / FORUM: Adding a forum summary

FORUM: Adding a forum summary

Author Message

Eivind Marienborg

Monday 19 July 2004 3:51:42 am

I have a series of sub-forums, much like these community-forums at EZ.no. WHat I want is a summary with the latest topics/replies like the one presented at http://ez.no/community/forum . How do I do that?

Clay Pereira

Monday 19 July 2004 7:37:42 am

Hello,

Here is the code I use for summarising my folders. Replace my_forum_id with the node_id of your forum.

{let children=fetch( content,
                     list,
                     hash( parent_node_id,     my_form_id,
                           class_filter_type,  include,
                           class_filter_array, array( 'forum' ),
                           sort_by,            $node.sort_array ) ) }

	{section name=Child loop=$children sequence=array(bglight,bgdark) }

		      
			<div class="content-view-folder">
            
			{node_view_gui view=line content_node=$Child:item}

       				
   <ul>
       			    {let grandchildren=fetch('content',list,hash(parent_node_id,$Child:item.node_id, 'sort_by',array("name", true())))}
				
			    {section name=Grand loop=$:grandchildren}

<li><a href={$:item.url_alias|ezurl}>{$:item.object.data_map.name.content|wash}</li></a>
				
                  
			    {/section}
			    </ul>
	
			</div>
		
         {/section}

{/let}

Eivind Marienborg

Monday 19 July 2004 9:44:07 am

Works great! Thanks lots :D

Eivind Marienborg

Tuesday 20 July 2004 12:31:44 am

I did find it useful to add depth, 3, to include not only the topics, but the latest messages in each topic. Thanks again:)