inherit
269656
0
Nov 27, 2024 8:59:24 GMT -8
Aenwyn
54
July 2024
aenwyn
|
Post by Aenwyn on Aug 6, 2024 12:37:33 GMT -8
Hello, I was trying to find if there was an option to have custom fields that aren't filled out yet display as something until they are, and only came across this thread from 2020: support.proboards.com/thread/660747/custom-profile-fields-emptyI saw, back then, it was not possible. I wanted to ask if it is possible now? I wrote my code as this, hoping it would display TBD until a number had been added: {foreach $[user.custom_field]}{if $[user.custom_field.name] == "Magic skill"}<i>$[user.custom_field.value]</i>{else}TBD{/if}{/foreach} But that would always show TBD and never the number when I added it to a profile. I know this has to do with the fact that if a field isn't filled out, it technically doesn't 'exist'. I saw Kami posted a way around it in that 2020 thread, but it didn't work for me. So my question is simple, has anything like this been added since 2020, or is there maybe a plugin that let's you put a placeholder text in custom fields to work around this? Definitely no big deal if not! Just curious. Thanks!
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,527
August 2015
socalso
|
Post by Scott on Aug 6, 2024 12:49:26 GMT -8
Aenwyn - fyi I'm reading up on the other thread you linked. BRB.
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,527
August 2015
socalso
|
Post by Scott on Aug 6, 2024 13:26:29 GMT -8
EDITED WITH CORRECT TEMPLATE CODE: Aenwyn - if I read Kami 's instructions properly, and taking the code from your User Profile > Summary template, this is how to proceed: Where you have: {foreach $[user.custom_field]}{if $[user.custom_field.name] == "Combat skill"}<i>$[user.custom_field.value]</i>{/if}{/foreach} You would replace it with this: Combat skill: <span {foreach $[user.custom_field]}{if $[user.custom_field.name] == "Combat skill"}style="display:none;"{/if}{/foreach}><i>TBD</i></span>{foreach $[user.custom_field]}{if $[user.custom_field.name] == "Combat skill"}<i>$[user.custom_field.value]</i>{/if}{/foreach} Give this one a try and let me know how it goes. (If it doesn't please leave the code in place for me to look at.) Also, note you would need to do this for the other two.
|
|
inherit
269656
0
Nov 27, 2024 8:59:24 GMT -8
Aenwyn
54
July 2024
aenwyn
|
Post by Aenwyn on Aug 6, 2024 13:30:55 GMT -8
Scott - I won't be able to try it until tomorrow, but I'll post here again when I'm able to check! I'm on phone right now so it's difficult to copy-paste coding, but I would use it specifically for a combat and family section (if you're able to see my coding, it's relatively at the bottom) which has some div classes which might complicate things (?). So I will test it with the OOC name and the combat custom fields when I can. Thanks! EDIT: I was able to copy paste it haha. I don't know if it helps but in case it does: <td class="summary-left-col"><div class="summary-content-box"><table> <tbody><div class="comcen"><div class="combat"><div class="combatstufftitle"><b>COMBAT SKILL</b></div><br><div class="combatstuffvalue"> {foreach $[user.custom_field]}{if $[user.custom_field.name] == "Combat skill"}<i>$[user.custom_field.value]</i>{/if}{/foreach} </div></div><div class="combattwo"><div class="combatstufftitle"><b>MAGIC SKILL</b></div><br><div class="combatstuffvalue"> {foreach $[user.custom_field]} {if $[user.custom_field.name] == "Magic skill"}<i>$[user.custom_field.value]</i>{/if}{/foreach} </div></div></div></tbody></table></div><div class="summary-content-box"> <b>Family:</b><br> {foreach $[user.custom_field]}{if $[user.custom_field.name] == "Family"}$[user.custom_field.value]{/if}{/foreach} </div></td><
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,527
August 2015
socalso
|
Post by Scott on Aug 6, 2024 14:43:43 GMT -8
Aenwyn - I've edited my post above with revised code.
|
|
inherit
269656
0
Nov 27, 2024 8:59:24 GMT -8
Aenwyn
54
July 2024
aenwyn
|
Post by Aenwyn on Aug 7, 2024 5:16:56 GMT -8
Scott - it works! I only had to remove the first 'Combat skill:' because it was plain text and wasn't necessary for my set-up of the boxes but the code worked. Thanks!
|
|