inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2013 1:33:47 GMT -8
Forum URL: rpg.proboards.comHi there! I'm using this to show a year, etc in the profile. {if $[user.mini_custom_field.name] == "Year"}<tr><td width="100%" colspan="2">$[user.mini_custom_field.value] Year {if $[user.mini_custom_field.name] == "Prefect"} $[user.mini_custom_field.value] {/if}</td></tr>{/if} How can I get it to show the Prefect part? It keeps showing up blank. Same part keeps happening for the next line: {if $[user.mini_custom_field.name] == "Biography Link"}<tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a href="$[user.mini_custom_field.value]" target="_blank">bio</a> / {if $[user.mini_custom_field.name] == "Plot Link"}<a href="$[user.mini_custom_field.value]" target="_blank">plot</a>{/if} </span></td></tr>{/if}
Thanks!
|
|
#eb7100
1480
0
1
Dec 4, 2024 4:15:04 GMT -8
Craig
209,210
September 2001
cmdynasty
|
Post by Craig on Apr 29, 2013 3:36:29 GMT -8
Hi Post in the template modifications board.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Apr 29, 2013 4:16:03 GMT -8
I went ahead and moved this to the template board for you
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2013 4:24:31 GMT -8
Thanks. I tried a bunch of different things and looked through practically everything. Seems this feature doesn't exist. I'll just find a work around or not use it.
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Apr 29, 2013 10:37:33 GMT -8
{foreach $[user.mini_custom_field]} {if $[user.mini_custom_field.name] == "Year"}<tr><td width="100%" colspan="2">$[user.mini_custom_field.value] Year{/if} {if $[user.mini_custom_field.name] == "Prefect"} $[user.mini_custom_field.value] {/if}</td></tr>{/foreach}
Try that. I didn't test it so I can't say for sure if it'll work. but I'm pretty sure it should.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2013 14:47:40 GMT -8
Hi there. That does not work, unfortunately. I tried that tactic. You cannot declare a foreach within a foreach. I tried not using foreach, the lines don't display. The code I provided within a foreach only shows the first option but not a second. Your example, sadly shows neither. It looks like as of now you can't have two variables within one if line.
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Apr 29, 2013 17:00:45 GMT -8
Where exactly are you placing this? As it works on my test forum.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2013 17:37:06 GMT -8
Where exactly are you placing this? As it works on my test forum. Here. {foreach $[user.mini_custom_field]} {if $[user.mini_custom_field.name] == "Year"}<tr><td width="100%" colspan="2" align="center">$[user.mini_custom_field.value] Year {if $[user.mini_custom_field.name] == "Prefect"} $[user.mini_custom_field.value] {/if}</td></tr> {/if} {if $[user.mini_custom_field.name] == "Character Age"}<tr><td width="50%"><b>Age:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Blood Status"}<tr><td width="50%"><b>Purity:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Relationship Status"}<tr><td width="50%"><b>Relationship Status:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Special Ability"}<tr><td width="50%"><b>Special Ability:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Quidditch Position"}<tr><td width="50%"><b>Quidditch Position:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Clubs"}<tr><td width="50%"><b>Clubs:</b></td><td width="50%">$[user.mini_custom_field.value]</td></tr> {/if} {if $[user.mini_custom_field.name] == "Biography Link"}<tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a href="$[user.mini_custom_field.value]" target="_blank">bio</a> / {if $[user.mini_custom_field.name] == "Plot Link"}<a href="$[user.mini_custom_field.value]" target="_blank">plot</a>{/if} </span></td></tr>{/if} {/foreach} A foreach within each doesn't work. And if one part of your example isn't filled out, there are stray td/tr tags that exist. Using an example based on what you provided: {if $[user.mini_custom_field.name] == "Year"}<tr><td width="100%" colspan="2" align="center">$[user.mini_custom_field.value] Year {/if}{if $[user.mini_custom_field.name] == "Prefect"} $[user.mini_custom_field.value] test {/if}</td></tr>
Adds an extra td/tr and the placement goes wrong.
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Apr 29, 2013 17:47:09 GMT -8
Alright. I only added the foreach because I didn't know you had it in something.
|
|
inherit
167837
0
Apr 30, 2013 15:32:12 GMT -8
leif
939
June 2011
akiglass
|
Post by leif on Apr 29, 2013 17:49:40 GMT -8
I think I finally thought of a workaround. I spent the last sixteen hours banging my head on this. Gonna go test it. {if $[user.mini_custom_field.name] == "Biography Link"}<tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a href="$[user.mini_custom_field.value]" target="_blank">bio</a> {else} <tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a onclick="alert('No biography link provided');" target="_blank">bio</a> {/if} / {if $[user.mini_custom_field.name] == "Plot Link"}<a href="$[user.mini_custom_field.value]" target="_blank">plot</a>{else}<a onclick="alert('No biography link provided');" target="_blank">plot</a> </span></td></tr>
Obviously, ProBoards is a bit inferior to self-hosted and other forums in mini-profiles right now. Oh well, I'm sure PB will have it eventually! Just gotta wait then, it's still early in this version and this is probably a lower priority. ^_^ Thanks. The workaround did not work.
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Apr 30, 2013 11:45:12 GMT -8
I think I finally thought of a workaround. I spent the last sixteen hours banging my head on this. Gonna go test it. {if $[user.mini_custom_field.name] == "Biography Link"}<tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a href="$[user.mini_custom_field.value]" target="_blank">bio</a> {else} <tr><td width="100%" colspan="2" align="center" style="background-color: #002627;"><span style="color: #FFFFFF;"><a onclick="alert('No biography link provided');" target="_blank">bio</a> {/if} / {if $[user.mini_custom_field.name] == "Plot Link"}<a href="$[user.mini_custom_field.value]" target="_blank">plot</a>{else}<a onclick="alert('No biography link provided');" target="_blank">plot</a> </span></td></tr>
Obviously, ProBoards is a bit inferior to self-hosted and other forums in mini-profiles right now. Oh well, I'm sure PB will have it eventually! Just gotta wait then. ^_^ Thanks. Well if you got it then good. But I don't see how PB is inferior in respect to mini-profiles when you can create your own mini-profile.
|
|