XF 2.3 Variable to get total forums in a category?

Miyevan

New member
Good morning everyone,

Is there a variable I can use in templates to return the total of forums in a category? That doesn't include subforums of course just main forums.
I am thinking to create a category specifically for our game servers which should return total servers (total forums in that category) and total active players or currently online (I can do this using javascript).

Regards
 
Good morning everyone,

Is there a variable I can use in templates to return the total of forums in a category? That doesn't include subforums of course just main forums.
I am thinking to create a category specifically for our game servers which should return total servers (total forums in that category) and total active players or currently online (I can do this using javascript).

Regards
I don't recall seeing this in variables, but I don't think it would be impossible to do with a template edit using <xf:foreach> and <xf:set> to set a new variable and place it where you wanted.

Interesting concept that I could implement on one of my forums too. So, if it's not gotten to by someone else, I may have a solution to this sometime within the next 6 hours as I'm currently out.
 
I don't recall seeing this in variables, but I don't think it would be impossible to do with a template edit using <xf:foreach> and <xf:set> to set a new variable and place it where you wanted.

Interesting concept that I could implement on one of my forums too. So, if it's not gotten to by someone else, I may have a solution to this sometime within the next 6 hours as I'm currently out.
Thank you, meanwhile I will try this by creating an add-on.

Edit: Looks like {$children|count} is enough to return only Childs of the current Forum.

Screenshot at Nov 09 08-46-49.webp
 
Last edited:
  • Like
Reactions: frm
Back
Top Bottom