News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Moving a specific custom field in the profile view

Started by Aaron10, November 11, 2019, 03:03:48 PM

Previous topic - Next topic

Aaron10

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.

Arantor

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...

Diego Andrés

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

SMF Tricks - Free & Premium Responsive Themes for SMF.

Aaron10

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:



If not this isn't a big deal.

Arantor

If you select it as large text, you can even set the size of the text box...

Aaron10


Advertisement: