inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Mar 31, 2019 18:15:15 GMT -8
I've got a lead and a specific goal in mind, but I don't know what I'm doing wrong.
I want this string of code to tell me the amount of members in a certain group. I want it to be able to be stylized because this code will be going into a table code.
The code in question:
{foreach $[group]}{if $[group.name] == "Group's Name"}$[group.members.total]{/if}{/foreach}
I took a gamble and tried to produce what I wanted based on the group tab in the profile and what I've seen done in the Mini-Profile code; I think I'm on the right track, but I don't really know enough about this type of code to see what I'm doing wrong here though. If this is not the way to specify which group should be counted, what's the correct way? What am I doing wrong here?
I'll be forever grateful <3
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,779
January 2015
msg
|
Post by Lynx on Apr 1, 2019 6:53:48 GMT -8
I've got a lead and a specific goal in mind, but I don't know what I'm doing wrong. I want this string of code to tell me the amount of members in a certain group. I want it to be able to be stylized because this code will be going into a table code. The code in question: {foreach $[group]}{if $[group.name] == "Group's Name"}$[group.members.total]{/if}{/foreach}
I took a gamble and tried to produce what I wanted based on the group tab in the profile and what I've seen done in the Mini-Profile code; I think I'm on the right track, but I don't really know enough about this type of code to see what I'm doing wrong here though. If this is not the way to specify which group should be counted, what's the correct way? What am I doing wrong here? I'll be forever grateful <3 It's important to know where you are trying to place this code. Some template variables are specific to that template only and are not global. The $[news] variable, for example, is specific to just the home template, which means it can't be used in any other template because it doesn't exist in any other template.
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Apr 1, 2019 16:01:33 GMT -8
I've got a lead and a specific goal in mind, but I don't know what I'm doing wrong. I want this string of code to tell me the amount of members in a certain group. I want it to be able to be stylized because this code will be going into a table code. The code in question: {foreach $[group]}{if $[group.name] == "Group's Name"}$[group.members.total]{/if}{/foreach}
I took a gamble and tried to produce what I wanted based on the group tab in the profile and what I've seen done in the Mini-Profile code; I think I'm on the right track, but I don't really know enough about this type of code to see what I'm doing wrong here though. If this is not the way to specify which group should be counted, what's the correct way? What am I doing wrong here? I'll be forever grateful <3 It's important to know where you are trying to place this code. Some template variables are specific to that template only and are not global. The $[news] variable, for example, is specific to just the home template, which means it can't be used in any other template because it doesn't exist in any other template. The code will be going in the Forum Wrapper, should it be possible!
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Apr 1, 2019 16:02:07 GMT -8
LynxThe code will be going in the Forum Wrapper, should it be possible!
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,779
January 2015
msg
|
Post by Lynx on Apr 1, 2019 17:28:20 GMT -8
LynxThe code will be going in the Forum Wrapper, should it be possible! Doesn't look like it. Sorry. There's no $[group] template variable there. There isn't even a $[user] variable there. Each template has a list of variables that works on that template on the right side. If you don't see a variable there, it can't be used there.
|
|
Kami
Forum Cat
Posts: 40,029
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,029
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 1, 2019 18:43:11 GMT -8
Lynx The code will be going in the Forum Wrapper, should it be possible! Doesn't look like it. Sorry. There's no $[group] template variable there. There isn't even a $[user] variable there. Each template has a list of variables that works on that template on the right side. If you don't see a variable there, it can't be used there. To clarify: you can place anything in the forum wrapper and it will work with one caveat — it will only appear on pages where that variable is valid. The reason for this is that the forum wrapper wraps the forum (as it says on the tin) so technically any variable is accepted, but may not appear depending on whether or not the variable is found on the page you’re currently viewing.
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Apr 2, 2019 1:37:16 GMT -8
Aw, bummer! Thank you, guys.
|
|