Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 17, 2020 3:49:48 GMT -8
This may be a silly question but why are custom profile fields not appropriate for this? You can use the custom profile field modifier plugin to add descriptions on the edit profile page, then use the layout templates + css to customise.
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 17, 2020 14:31:28 GMT -8
This may be a silly question but why are custom profile fields not appropriate for this? You can use the custom profile field modifier plugin to add descriptions on the edit profile page, then use the layout templates + css to customise. Because of how many instances it would require. It would need me to make a custom field 3 times for each talent. If someone has upwards of 10 talents..that's 30 custom fields with if/else instances for each. Proboards has a limited amount of if/else statements you can use in profile templates. ...I found a work around though so I'm doing that instead. plugin no longer required.
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 17, 2020 14:57:28 GMT -8
This may be a silly question but why are custom profile fields not appropriate for this? You can use the custom profile field modifier plugin to add descriptions on the edit profile page, then use the layout templates + css to customise. Because of how many instances it would require. It would need me to make a custom field 3 times for each talent. If someone has upwards of 10 talents..that's 30 custom fields with if/else instances for each. Proboards has a limited amount of if/else statements you can use in profile templates. ...I found a work around though so I'm doing that instead. plugin no longer required. There's a limit to foreach loops, but not if/else statements. as long as you had one or two foreach loops you could have whatever you had. I'm entirely certain you'd be able to pull this off with not as much work as you're imagining outside of actually creating each field but if you've found a way you're happy with then woo hoo!
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 15:26:37 GMT -8
well if you can think of a way to condense my foreach, I would prefer that. t his is what my code looks like though this is even without the icons I wanted: <table width="100%" style="background-color:#e6e6e6;border: 3px solid #fff; position:relative; left:10px;"> <tr>
<td width="13%"> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 1} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td width="37%"> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 1} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
<td width="13%"> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 2} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td width="37%"> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 2} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
</tr> <tr>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 3} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 3} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 4} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 4} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
</tr> <tr> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 5} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 5} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 6} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 6} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
</tr> <tr>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 7} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 7} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 8} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 8} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td>
</tr> <tr>
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 9} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 9} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach}
<td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Value 10} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> <td> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Talent Desc 10} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} {/foreach} </td> </tr> </table> <div style="padding-left:10px;">
{foreach $[user.custom_field]} {if $[user.custom_field.name] == "Linguistics"} <div style="width:345px; border-left:3px solid #fff; border:3px solid #056d77"> <div class="talent_desc" style="background-color:#056d77!important;"> <div class="talent_desc_ft" style="color:#fff!important; border:none!important"> $[user.custom_field.value] </div> </div> </div>
{/if} {/foreach} Not sure how I can condesne that. Because of how many instances it would require. It would need me to make a custom field 3 times for each talent. If someone has upwards of 10 talents..that's 30 custom fields with if/else instances for each. Proboards has a limited amount of if/else statements you can use in profile templates. ...I found a work around though so I'm doing that instead. plugin no longer required. There's a limit to foreach loops, but not if/else statements. as long as you had one or two foreach loops you could have whatever you had. I'm entirely certain you'd be able to pull this off with not as much work as you're imagining outside of actually creating each field but if you've found a way you're happy with then woo hoo! Because of how many instances it would require. It would need me to make a custom field 3 times for each talent. If someone has upwards of 10 talents..that's 30 custom fields with if/else instances for each. Proboards has a limited amount of if/else statements you can use in profile templates. ...I found a work around though so I'm doing that instead. plugin no longer required. There's a limit to foreach loops, but not if/else statements. as long as you had one or two foreach loops you could have whatever you had. I'm entirely certain you'd be able to pull this off with not as much work as you're imagining outside of actually creating each field but if you've found a way you're happy with then woo hoo!
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 16:05:59 GMT -8
so quick clarifying question: what is the behaviour of these fields, ideally, if the content is not filled in? i know you mentioned you were micromanaging the field contents, but let's say there's a member you haven't gotten to yet. what would that look like from a user-end, when the fields are empty?
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 17:15:04 GMT -8
so quick clarifying question: what is the behaviour of these fields, ideally, if the content is not filled in? i know you mentioned you were micromanaging the field contents, but let's say there's a member you haven't gotten to yet. what would that look like from a user-end, when the fields are empty? It disappears all together. The fields only appear when it's filled in. Not filled in: filled in:
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 17:39:21 GMT -8
so quick clarifying question: what is the behaviour of these fields, ideally, if the content is not filled in? i know you mentioned you were micromanaging the field contents, but let's say there's a member you haven't gotten to yet. what would that look like from a user-end, when the fields are empty? It disappears all together. The fields only appear when it's filled in. OK so, as a starting point for you since you know your way around layout templates would be to structure this so the entire table + div is wrapped in a 'foreach' loop for the custom fields, like so: {foreach $[user.custom_field]} --table here --div here {/foreach} Then we're going to cheat. The foreach loop's basic function is to treat all fields the same way: "if any field appears, it should look like this". Since you're calling out individual fields & their associated values, you can simply remove the individual fields' "foreach" loops. Here's an example from my test forum: {foreach $[user.custom_field]}
<table>
<tr><td>{if $[user.custom_field.name] == "Test Field 1"}$[user.custom_field.value]{/if}</td></tr> <tr><td style="background-color:#ff0000;"> Field Two: <span {if $[user.custom_field.name] == "Test Field 2"}style="display:none;"{/if}>This is a default answer if blank</span>{if $[user.ustom_field.name] == "Test Field 2"}$[user.custom_field.value]{/if}</td></tr>
</table>
{/foreach}
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 18:00:12 GMT -8
Okay I'll try it out and let you know. Thank you Kami.
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 18:12:20 GMT -8
You're welcome!
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 18:26:41 GMT -8
It disappears all together. The fields only appear when it's filled in. OK so, as a starting point for you since you know your way around layout templates would be to structure this so the entire table + div is wrapped in a 'foreach' loop for the custom fields, like so: {foreach $[user.custom_field]} --table here --div here {/foreach} Then we're going to cheat. The foreach loop's basic function is to treat all fields the same way: "if any field appears, it should look like this". Since you're calling out individual fields & their associated values, you can simply remove the individual fields' "foreach" loops. It's working but it also is messing with the styles, so I'm not sure how to make the styles look appropriate again. pretty much what I did..using spans instead of divides don't work either...it's pretty much adding line breaks between them and I don't know how to account for that. Is that what you were doing with the placeholders (display:none)?? {foreach $[user.custom_field]} <table width="100%" style="background-color:#e6e6e6;border: 3px solid #fff; position:relative; left:10px;"> <tr>
<td width="13%">
{if $[user.custom_field.name] == "Talent Value 1} <div class="talent_stat"> <div class="talent_stat_ft"> $[user.custom_field.value] </div> </div> {/if}
</td> <td width="37%">
{if $[user.custom_field.name] == "Talent Desc 1} <div class="talent_desc"> <div class="talent_desc_ft"> $[user.custom_field.value] </div> </div> {/if} </td>
</tr> </table> {/foreach}
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 18:42:41 GMT -8
without knowing the CSS for your divs I can't really help; mind posting it?
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 18:45:45 GMT -8
without knowing the CSS for your divs I can't really help; mind posting it? .talent_stat{ background-color:#056d77;
}
.talent_stat_ft { padding-top:20px; padding-bottom:20px; border:2px solid #d8d8d8; color:#fff; font-size:18px; text-align:center; text-transform:uppercase; font-family: 'Oswald', sans-serif; }
.talent_desc { background-color:#e6e6e6; text-align:center; }
.talent_desc_ft { padding-top:20px; padding-bottom:20px; border:2px solid #d8d8d8; color:#056d77; font-size:18px; text-transform:uppercase; font-family: 'Oswald', sans-serif; }
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 18:53:01 GMT -8
to start, remove the padding (set to 0) and add it in incrementally.
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Aug 18, 2020 18:58:03 GMT -8
to start, remove the padding (set to 0) and add it in incrementally. Done! even with the padding gone, it is still line breaking the table data.
|
|
Kami
Forum Cat
Posts: 40,020
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,020
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 18, 2020 19:13:48 GMT -8
to start, remove the padding (set to 0) and add it in incrementally. Done! even with the padding gone, it is still line breaking the table data. wanna pm me a link so i can register a test acct?
|
|