Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

<%loop everything%> - need help

Quote Reply
<%loop everything%> - need help
Hi,

I try to use this loop in my own template:

<%set indent = '&nbsp;&nbsp;&nbsp;&nbsp;'%>
<%loop everything%>
<%unless forum_id%><%-- A category --%>
<option value="<%cat_name%>"><%indent x $cat_depth%><%cat_name%> (les sections de cette catégorie)</option>
<%else%>
<option value="<%forum_name%>">
<%indent x $cat_depth%>&nbsp;&nbsp;&nbsp;&nbsp;<%forum_name%></option>
<%endunless%>
<%endloop%>

The loop doesn't print anything. Should I put a global in the template to make it works? If so, which one?

Thank you!

François
Quote Reply
Re: [Franco] <%loop everything%> - need help In reply to
Is this on the category_list.html template? If not, you can get at it by using a global that calls the GForum category list function:

Code:
sub {
require GForum::Category;
(GForum::Category->list)[1];
}

Then you'll have the num_root_cats variable and the everything loop available in the template.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Last edited by:

Jagerman: Apr 21, 2003, 2:50 PM
Quote Reply
Re: [Jagerman] <%loop everything%> - need help In reply to
It's not in category_list.html.

When I call the global in the template I get a fatal error: "Not an ARRAY reference at (eval 16) line 3."

Thank you!

François
Quote Reply
Re: [Jagerman] <%loop everything%> - need help In reply to
Hi,

I tried also the solution in this post http://www.gossamer-threads.com/...i?post=179440#179440, but it still not working (get a fatal error).

Thank you for your help!

François
Quote Reply
Re: [Franco] <%loop everything%> - need help In reply to
Oops - okay, should work now.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com