application custom field mini profile help

haikuwu
aliasCooked Bread
pronounsThey / Him
623written posts
Toastyearned bits
offlinecurrently
Toasty
Part of the Furniture
Toasty Avatar
>w<



The first photo is my code, and the second is how it turned out. Basically, the link showed up for how many profile fields there were, and at the moment there were many. Each one had a link to the site and then the field. I just want it to be a way to have a link to the application! Thanks to all who help!
540written posts
Sharpearned bits
offlinecurrently
Sharp
Part of the Furniture
Sharp Avatar
I like big fonts and I cannot lie
I hope this helps, I apologize if I misunderstood or if this isn't helpful. I would guess your last custom field is hobby or something which is pulling the word "writer" into your link field and proboards will read that as an empty value and produce your current page. An if statement should help to pick out the right custom field. The way i've seen link wrapping done is with two if statements: one to open the link and another to close it, which is ideal when you don't want the object to go away when the custom field is empty.


//Check each custom field. If one is called Application, open up the beginning of a link to wrap around your span/div/whatever. If not the code will skip this statement.

{foreach $[user.mini_custom_field]}{if $[user.mini_custom_field.name] == "Application"}<a href="$[user.mini_custom_field.value]">{/if}{/foreach}  


//Create the contents coded in the class around the word Application. This will populate even if the statement above it is not true, but it will not have a link around it. This means you can style it to appear differently if it isn't linked. (.longThing {} vs .longThing a {})

<span class="longThing">Application</span>

//If the first statement was true, then this statement will be true as well. This tells the link to close.

{foreach $[user.mini_custom_field]}{if $[user.mini_custom_field.name] == "Application"}</a>{/if}{/foreach}
last edit on Nov 11, 2021 9:50:53 GMT by Sharp
haikuwu
aliasCooked Bread
pronounsThey / Him
623written posts
Toastyearned bits
offlinecurrently
Toasty
Part of the Furniture
Toasty Avatar
>w<
Sharp Avatar
I hope this helps, I apologize if I misunderstood or if this isn't helpful. I would guess your last custom field is hobby or something which is pulling the word "writer" into your link field and proboards will read that as an empty value and produce your current page. An if statement should help to pick out the right custom field. The way i've seen link wrapping done is with two if statements: one to open the link and another to close it, which is ideal when you don't want the object to go away when the custom field is empty.


//Check each custom field. If one is called Application, open up the beginning of a link to wrap around your span/div/whatever. If not the code will skip this statement.

{foreach $[user.mini_custom_field]}{if $[user.mini_custom_field.name] == "Application"}<a href="$[user.mini_custom_field.value]">{/if}{/foreach}  


//Create the contents coded in the class around the word Application. This will populate even if the statement above it is not true, but it will not have a link around it. This means you can style it to appear differently if it isn't linked. (.longThing {} vs .longThing a {})

<span class="longThing">Application</span>

//If the first statement was true, then this statement will be true as well. This tells the link to close.

{foreach $[user.mini_custom_field]}{if $[user.mini_custom_field.name] == "Application"}</a>{/if}{/foreach}
Sorry for the late reply, but it worked! Thank you very much!
internally screaming
pronounsshe/her
1,799written posts
Nekoearned bits
offlinecurrently
Neko
Administrator
Neko Avatar
stressed, depressed, and probably not well-dressed
[nospaces]

[attr="class","infoBG"]
[attr="class","infoBG2"]
[attr="class","infoBack"]
[attr="class","infoTitle"][attr="class","fa fa-star-o"] threadarchived
[attr="class","infoDiv"]

[attr="class","infoBody"]

This thread hasn't had any replies since a month ago - feel free to repost if you wish!