Schaken Posted July 18, 2022 Posted July 18, 2022 I am having trouble with customFields displaying properly. For example, i make a custom field for my users to select another member that helped them create the uploaded content. So, in the custom field they are able to select any other member's name. This works fine normally, but whe i try to customize my page to put this custom field near the uploaders name, I seem to only be able to retrieve the members ID number. {{$fields = $file->customFields();}} {{if $fields['field_5']}} and {$fields['field_5']['value']|raw}{{endif}} I tried this many ways, I can't seem to get it to come out correctly. I did this using pages app as well for testing and i got a whole HTML code but couldn't ever get it to display correctly over there either. Does anyone have any suggestions? If I leave it original, it shows up in my side panel and will show the users name and it's hyperlinked to their account, which is what I'm wanting, but up by the uploaders name.
opentype Posted July 18, 2022 Posted July 18, 2022 If you just have an ID, you need to get the member object for that ID to access the additional data. {{$fullMemberData = \IPS\Member::load($theMemberID);}}
Schaken Posted July 18, 2022 Author Posted July 18, 2022 8 hours ago, opentype said: If you just have an ID, you need to get the member object for that ID to access the additional data. {{$fullMemberData = \IPS\Member::load($theMemberID);}} So, If I am not mistaking, what i would need would be something like... {{$fields = $file->customFields();}} {{if $fields['field_5']}} and $fullMemberData = \IPS\Member::load($fields['field_5']['value']|raw){{endif}} I appreciate your assistance by the way, You seem to be the master of the pages app, I see thats where you thrive. I will give this a shot and see if i can get this to work. I mostly mess with C# so alot of this is familiar, but just different syntax.
Schaken Posted July 18, 2022 Author Posted July 18, 2022 {{$fields = $file->customFields();}} {{$fullMemberData = \IPS\Member::load($fields['field_5']['value']|raw)}} {{if $fields['field_5']}} and {$fullMemberData}{{endif}} hm. this failed for me too. im not sure I can use it this way. I'm sure i'm missing something somewhere.
Recommended Posts