Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Aaron10 on November 11, 2019, 03:03:48 PM

Title: Moving a specific custom field in the profile view
Post by: Aaron10 on November 11, 2019, 03:03:48 PM
Hi, I have made a custom field called "Biography" in which users can make a small paragraph, in profile.template.php I have this above the "username" field

<span style="font-weight: bold;">Biography:</span><br>
', $context['member']['options']['cust_biogra'], '<br>';


It works as expected however if the user hasn't set anything I of course get an undefined error in the log regarding the ['cust_biogra']. So if there's nothing set I need to simple just have a line break.
Title: Re: Moving a specific custom field in the profile view
Post by: Arantor on November 11, 2019, 03:10:05 PM
How exactly did you make it? Seems like you didn't use the built in feature that would hide it if there wasn't a value set...
Title: Re: Moving a specific custom field in the profile view
Post by: Diego Andrés on November 11, 2019, 03:33:51 PM
I think he's trying to display it some place more specific than what the custom fields offers.

Op:
You'd need to use: if(!empty($context['member']['options']['cust_biogra'])) to solve your issue I believe
Title: Re: Moving a specific custom field in the profile view
Post by: Aaron10 on November 11, 2019, 03:56:42 PM
Yes that's correct, and that works great now thank you. One other small thing, I don't think you can change this in the Custom Fields area, so is it possible to modify the specific field input size for "Biography" to the same size as the Signature's input box? Like so:

(https://i.imgur.com/JJwFrAX.png)

If not this isn't a big deal.
Title: Re: Moving a specific custom field in the profile view
Post by: Arantor on November 11, 2019, 04:21:57 PM
If you select it as large text, you can even set the size of the text box...
Title: Re: Moving a specific custom field in the profile view
Post by: Aaron10 on November 11, 2019, 04:26:51 PM
Oh that's what that is, okay lol