inherit
128089
0
May 2, 2021 13:47:42 GMT -8
Kalimalian
Constantly biting my tongue
3,223
July 2008
kalimalian
|
Post by Kalimalian on Feb 20, 2020 5:55:29 GMT -8
So I thought I had this working, but I came back to it after a few weeks gap and it's...not. I have a custom profile field called 'Profile' set to plain text and location profiles and mini profiles. The idea is that the user enters a URL in the field in their edit profile tab, and the URL displays as a clickable link called 'Here' in the mini profile (profile can come later...) I only want it to show for accounts in the Character group. This is the code I have in the mini profile template {if $[user.group.name] == "Character" $[user.mini_custom_field.name] == Profile} <br />Profile: <a href="$[user.mini_custom_field.value]">Here</a>{/if} I'm certain it was previously working, but now the field only displays the URL, not the clickable link. Example hereEdit:I think I've fixed it! But if there's a neater way to lay out the code, I'd be happily corrected {foreach $[user.mini_custom_field]} {if $[user.mini_custom_field.name] != "Image"} {if $[user.mini_custom_field.name] != "Profile"} <br /><span class="$[user.mini_custom_field.content_class]">$[user.mini_custom_field.name]: $[user.mini_custom_field.value]</span> {/foreach} {if $[user.group.name] == "Character" || $[user.mini_custom_field.name] == "Profile"} <br />Profile: <a href="$[user.mini_custom_field.value]">Here</a>{/if}
|
|
#eb7100
33409
0
1
Nov 13, 2024 16:56:46 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 20, 2020 12:29:49 GMT -8
Living pretty dangerously with the amount of unclosed statements you've got there. The easiest way to tell if you're missing opening or closing tags for elements/statements is to indent every time you enter a new block. Note in the example below that two closing {/if} tags are missing inside your loop: With that aside, it's worth noting that $[user.mini_custom_field.name] only returns the name of a custom field while inside the loop. The one used in the if statement outside of the foreach loop doesn't currently do anything. This is a cleaned up version of the code you've posted with every error mentioned corrected:
|
|
inherit
128089
0
May 2, 2021 13:47:42 GMT -8
Kalimalian
Constantly biting my tongue
3,223
July 2008
kalimalian
|
Post by Kalimalian on Feb 21, 2020 11:44:36 GMT -8
Thanks so much Brian I'm super rusty, so the help is appreciated.
|
|